feature
This commit is contained in:
@@ -6,7 +6,7 @@ use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
|
||||
class Admin extends Authenticatable
|
||||
{
|
||||
protected $fillable = ['username', 'password'];
|
||||
protected $fillable = ['username', 'password', 'is_super'];
|
||||
|
||||
protected $hidden = ['password', 'remember_token'];
|
||||
|
||||
@@ -14,6 +14,12 @@ class Admin extends Authenticatable
|
||||
{
|
||||
return [
|
||||
'password' => 'hashed',
|
||||
'is_super' => 'integer',
|
||||
];
|
||||
}
|
||||
|
||||
public function isSuper(): bool
|
||||
{
|
||||
return (int) $this->is_super === 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user