From d9f89ab777d56f44fe92fb33e14a954bbd2c790e Mon Sep 17 00:00:00 2001 From: Jordan Hoff Date: Wed, 27 Mar 2024 21:31:12 -0600 Subject: [PATCH] Fix php8.2 deprecations --- src/Http/Middleware/AuthenticateApiKey.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/Http/Middleware/AuthenticateApiKey.php b/src/Http/Middleware/AuthenticateApiKey.php index fe401f7..4aea18e 100644 --- a/src/Http/Middleware/AuthenticateApiKey.php +++ b/src/Http/Middleware/AuthenticateApiKey.php @@ -18,7 +18,6 @@ class AuthenticateApiKey */ public function handle($request, Closure $next, $guard = null) { - //Get API token from request $token = $this->getKeyFromRequest($request); @@ -50,9 +49,9 @@ public function handle($request, Closure $next, $guard = null) } //Attach the apikey object to the request - $request->apiKey = $apiKey; + $request->merge(['apiKey' => $apiKey]); if ($keyable) { - $request->keyable = $keyable; + $request->merge(['keyable' => $keyable]); } //Update last_used_at @@ -65,7 +64,7 @@ public function handle($request, Closure $next, $guard = null) protected function getKeyFromRequest($request) { $mode = config('keyable.mode', 'bearer'); - + switch ($mode) { case 'bearer': return $request->bearerToken();