From 5a72bb06005e891b84f86ff9ae2dd8e8d366064a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20M=2E?= Date: Thu, 10 Oct 2024 17:48:22 +0200 Subject: [PATCH] Convert to non-static --- src/Auth/Concerns/WithAuthentication.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Auth/Concerns/WithAuthentication.php b/src/Auth/Concerns/WithAuthentication.php index 67023fd3..0c01c2f9 100644 --- a/src/Auth/Concerns/WithAuthentication.php +++ b/src/Auth/Concerns/WithAuthentication.php @@ -6,33 +6,33 @@ trait WithAuthentication { - protected static function isAuthenticated(): bool + protected function isAuthenticated(): bool { return auth()->check(); } - protected static function getAuthUser(): ?User + protected function getAuthUser(): ?User { return auth()->user(); } - protected static function getAuthId(): int|string|null + protected function getAuthId(): int|string|null { return auth()->id(); } - protected static function getAuthKey(): int|string|null + protected function getAuthKey(): int|string|null { - return static::getAuthUser()?->getRouteKey(); + return $this->getAuthUser()?->getRouteKey(); } - protected static function can(string $ability, mixed $arguments = []): bool + protected function can(string $ability, mixed $arguments = []): bool { - return static::getAuthUser()->can($ability, $arguments); + return $this->getAuthUser()->can($ability, $arguments); } - protected static function cannot(string $ability, mixed $arguments = []): bool + protected function cannot(string $ability, mixed $arguments = []): bool { - return static::getAuthUser()->cannot($ability, $arguments); + return $this->getAuthUser()->cannot($ability, $arguments); } }