*/ public static function operatorRoles(): array { return Role::query() ->where('guard_name', 'operator') ->orderBy('name') ->pluck('name') ->all(); } protected $fillable = ['name', 'email', 'password', 'last_login_at', 'disabled_at']; protected $hidden = ['password', 'remember_token', 'two_factor_secret', 'two_factor_recovery_codes']; protected function casts(): array { return [ 'password' => 'hashed', 'last_login_at' => 'datetime', 'disabled_at' => 'datetime', 'two_factor_confirmed_at' => 'datetime', ]; } /** True when this operator holds a role that reaches the console. */ public function isOperator(): bool { return $this->hasAnyRole(self::operatorRoles()); } /** A disabled operator keeps their record and loses their access. */ public function isActive(): bool { return $this->disabled_at === null; } }