Skip to content

Instantly share code, notes, and snippets.

@mercuryseries
Created September 26, 2016 06:46
Show Gist options
  • Save mercuryseries/695631eaa0ff7d2ac11d21d7d01b1d4a to your computer and use it in GitHub Desktop.
Save mercuryseries/695631eaa0ff7d2ac11d21d7d01b1d4a to your computer and use it in GitHub Desktop.
Basic Authentication User Model [Example]
<?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