| Total Complexity | 1 |
| Total Lines | 75 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class User extends Authenticatable |
||
| 11 | { |
||
| 12 | use HasRoleAndPermission; |
||
|
|
|||
| 13 | use Notifiable; |
||
| 14 | use SoftDeletes; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * The database table used by the model. |
||
| 18 | * |
||
| 19 | * @var string |
||
| 20 | */ |
||
| 21 | protected $table = 'users'; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * The attributes that are not mass assignable. |
||
| 25 | * |
||
| 26 | * @var array |
||
| 27 | */ |
||
| 28 | protected $guarded = ['id']; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * The attributes that are mass assignable. |
||
| 32 | * |
||
| 33 | * @var array |
||
| 34 | */ |
||
| 35 | protected $fillable = [ |
||
| 36 | 'name', |
||
| 37 | 'email', |
||
| 38 | 'password', |
||
| 39 | ]; |
||
| 40 | |||
| 41 | /** |
||
| 42 | * The attributes that should be hidden for arrays. |
||
| 43 | * |
||
| 44 | * @var array |
||
| 45 | */ |
||
| 46 | protected $hidden = [ |
||
| 47 | 'password', |
||
| 48 | 'remember_token', |
||
| 49 | ]; |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Typecasted dates. |
||
| 53 | * |
||
| 54 | * @var array |
||
| 55 | */ |
||
| 56 | protected $dates = [ |
||
| 57 | 'created_at', |
||
| 58 | 'updated_at', |
||
| 59 | 'deleted_at', |
||
| 60 | ]; |
||
| 61 | |||
| 62 | /** |
||
| 63 | * Typecasting is awesome. |
||
| 64 | * |
||
| 65 | * @var array |
||
| 66 | */ |
||
| 67 | protected $casts = [ |
||
| 68 | 'name' => 'string', |
||
| 69 | 'email' => 'string', |
||
| 70 | 'password' => 'string', |
||
| 71 | ]; |
||
| 72 | |||
| 73 | /** |
||
| 74 | * Scope a query the user names. |
||
| 75 | * |
||
| 76 | * @param \Illuminate\Database\Eloquent\Builder $query |
||
| 77 | * |
||
| 78 | * @return \Illuminate\Database\Eloquent\Builder |
||
| 79 | */ |
||
| 80 | public function scopeUserNames($query) |
||
| 87 |