Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gammamatrix committed Feb 10, 2024
1 parent 4ded607 commit 3318ff0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions config/playground-auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
// 'abilities' => '',
// 'abilities' => 'user',
'abilities' => 'merge',
// 'expires' => 'tomorrow midnight',
'expires' => null,
'expires' => 'tomorrow midnight',
// 'expires' => null,
'name' => 'app',
// @see playground.auth.token.name
'listed' => false,
Expand Down
11 changes: 6 additions & 5 deletions src/Issuer.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,18 +206,19 @@ public function sanctum(HasApiTokens $user): array
$name = $config['name'];
}

// $expiresAt = null;
// if (! empty($config['expires']) && is_string($config['expires'])) {
// $expiresAt = new Carbon($config['expires']);
// }
$expiresAt = null;
if (! empty($config['expires']) && is_string($config['expires'])) {
$expiresAt = Carbon::parse($config['expires']);
}

// dd([
// '__METHOD__' => __METHOD__,
// 'createToken' => $user->createToken($name, $abilities, $expiresAt)->toArray(),
// ]);
$tokens[$name] = $user->createToken(

Check failure on line 218 in src/Issuer.php

View workflow job for this annotation

GitHub Actions / build

Method Laravel\Sanctum\Contracts\HasApiTokens::createToken() invoked with 3 parameters, 1-2 required.
$name,
$this->abilities($user)
$this->abilities($user),
$expiresAt
)->plainTextToken;

return $tokens;
Expand Down

0 comments on commit 3318ff0

Please sign in to comment.