Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
francoism90 committed Oct 31, 2024
1 parent 194f7ab commit 5c766cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Auth/Concerns/WithAuthentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ protected function getAuthKey(): int|string|null

protected function can(string $ability, mixed $arguments = []): bool
{
return Auth::user()->can($ability, $arguments);
return Auth::user()?->can($ability, $arguments);
}

protected function cannot(string $ability, mixed $arguments = []): bool
{
return Auth::user()->cannot($ability, $arguments);
return Auth::user()?->cannot($ability, $arguments);
}
}

0 comments on commit 5c766cb

Please sign in to comment.