* The attributes excluded from the model's JSON form.
* @var array
*/
- protected $hidden = ['password', 'remember_token', 'system_name', 'email_confirmed', 'external_auth_id', 'email'];
+ protected $hidden = [
+ 'password', 'remember_token', 'system_name', 'email_confirmed', 'external_auth_id', 'email',
+ 'created_at', 'updated_at', 'image_id',
+ ];
/**
* This holds the user's permissions when loaded.
/**
* Check if the user has a role.
- * @param $role
- * @return mixed
*/
- public function hasRole($role)
+ public function hasRole($roleId): bool
{
- return $this->roles->pluck('name')->contains($role);
+ return $this->roles->pluck('id')->contains($roleId);
}
/**
/**
* Attach a role to this user.
- * @param Role $role
*/
public function attachRole(Role $role)
{