Added const for user level
This commit is contained in:
@@ -24,6 +24,20 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
||||
{
|
||||
use Authenticatable, CanResetPassword, ValidatingTrait;
|
||||
|
||||
/**
|
||||
* The admin level of user.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
const LEVEL_ADMIN = 1;
|
||||
|
||||
/**
|
||||
* The general level of user.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
const LEVEL_USER = 2;
|
||||
|
||||
/**
|
||||
* The attributes that should be casted to native types.
|
||||
*
|
||||
@@ -144,7 +158,7 @@ class User extends Model implements AuthenticatableContract, CanResetPasswordCon
|
||||
*/
|
||||
public function getIsAdminAttribute()
|
||||
{
|
||||
return $this->level == 1;
|
||||
return $this->level == self::LEVEL_ADMIN;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user