Created
September 26, 2016 06:46
-
-
Save mercuryseries/695631eaa0ff7d2ac11d21d7d01b1d4a to your computer and use it in GitHub Desktop.
Basic Authentication User Model [Example]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App; | |
use App\Traits\HasSecurePassword; | |
use Illuminate\Database\Eloquent\Model; | |
class User extends Model | |
{ | |
use HasSecurePassword; | |
/** | |
* Validation rules | |
* | |
* @var array | |
*/ | |
protected $rules = [ | |
'name' => 'required|max:255', | |
'email' => 'required|email|max:255|unique:users', | |
'password' => 'required|min:6|confirmed', | |
]; | |
/** | |
* The attributes that are mass assignable. | |
* | |
* @var array | |
*/ | |
protected $fillable = [ | |
'name', 'email', 'password', 'password_confirmation', | |
]; | |
/** | |
* The attributes that should be hidden for arrays. | |
* | |
* @var array | |
*/ | |
protected $hidden = [ | |
'password_digest', | |
]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment