user add exists method

This commit is contained in:
xiaomlove
2024-11-18 22:20:31 +08:00
parent 729e5a25cb
commit 3b09b8f79e
2 changed files with 6 additions and 1 deletions

View File

@@ -137,6 +137,11 @@ class User extends Authenticatable implements FilamentUser, HasName
return $result;
}
public static function exists($id): bool
{
return self::query()->where("id", $id)->exists();
}
public function canAccessFilament(): bool
{
return $this->canAccessAdmin();