add isRootAdmin() method to User model to get rid of User->root_admin === 1

This commit is contained in:
Jakob Schrettenbrunner 2017-01-18 21:13:05 +01:00
parent d3d1b88135
commit c0df57c087

View file

@ -146,4 +146,13 @@ class User extends Model implements AuthenticatableContract, AuthorizableContrac
{
$this->notify(new ResetPasswordNotification($token));
}
/**
* Return true or false depending on wether the user is root admin or not.
*
* @return boolean the user is root admin
*/
public function isRootAdmin() {
return $this->root_admin === 1;
}
}