From 7588b65b85e5fcc0987ccf015151fa88887ea466 Mon Sep 17 00:00:00 2001 From: erikn69 Date: Thu, 18 Jul 2024 12:32:01 -0500 Subject: [PATCH] feat: add macroable guards --- src/Guards/AuthenticationGuard.php | 5 ++++- src/Guards/AuthorizationGuard.php | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Guards/AuthenticationGuard.php b/src/Guards/AuthenticationGuard.php index e3cc4ff..5535f25 100644 --- a/src/Guards/AuthenticationGuard.php +++ b/src/Guards/AuthenticationGuard.php @@ -13,6 +13,7 @@ use Auth0\SDK\Utility\HttpResponse; use Illuminate\Auth\Events\{Login, Logout}; use Illuminate\Contracts\Auth\Authenticatable; +use Illuminate\Support\Traits\Macroable; use Throwable; @@ -26,7 +27,9 @@ * @api */ final class AuthenticationGuard extends GuardAbstract implements AuthenticationGuardContract -{ +{ + use Macroable; + /** * @var string */ diff --git a/src/Guards/AuthorizationGuard.php b/src/Guards/AuthorizationGuard.php index 0172038..5ebec05 100644 --- a/src/Guards/AuthorizationGuard.php +++ b/src/Guards/AuthorizationGuard.php @@ -8,6 +8,7 @@ use Auth0\Laravel\UserProviderContract; use Auth0\SDK\Utility\HttpResponse; use Illuminate\Contracts\Auth\Authenticatable; +use Illuminate\Support\Traits\Macroable; use function is_array; use function is_string; @@ -19,6 +20,8 @@ */ final class AuthorizationGuard extends GuardAbstract implements AuthorizationGuardContract { + use Macroable; + public function find(): ?CredentialEntityContract { if ($this->isImpersonating()) {