Skip to content

Commit

Permalink
Merge pull request #18 from givebutter/jhoff/php8.2_deprecations
Browse files Browse the repository at this point in the history
Fix php8.2 deprecations
  • Loading branch information
liran-co authored Mar 28, 2024
2 parents 002c132 + d9f89ab commit 41075c2
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Http/Middleware/AuthenticateApiKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class AuthenticateApiKey
*/
public function handle($request, Closure $next, $guard = null)
{

//Get API token from request
$token = $this->getKeyFromRequest($request);

Expand Down Expand Up @@ -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
Expand All @@ -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();
Expand Down

0 comments on commit 41075c2

Please sign in to comment.