*/ use HasFactory, HasRoles, Notifiable, TwoFactorAuthenticatable; /** The five operator roles that grant access to the admin console. */ public const OPERATOR_ROLES = ['Owner', 'Admin', 'Support', 'Billing', 'Read-only']; /** * True when this user is a CluPilot operator. Prefers RBAC roles, but keeps * the legacy is_admin flag as a fallback so an operator can never be locked * out of the console by a stale permission cache or a missing role. */ public function isOperator(): bool { return $this->is_admin || $this->hasAnyRole(self::OPERATOR_ROLES); } /** * Get the attributes that should be cast. * * @return array */ protected function casts(): array { return [ 'email_verified_at' => 'datetime', 'password' => 'hashed', 'is_admin' => 'boolean', ]; } }