Skip to content

Commit

Permalink
Convert to non-static
Browse files Browse the repository at this point in the history
  • Loading branch information
francoism90 authored Oct 10, 2024
1 parent 20be209 commit 5a72bb0
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/Auth/Concerns/WithAuthentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,33 @@

trait WithAuthentication
{
protected static function isAuthenticated(): bool
protected function isAuthenticated(): bool
{
return auth()->check();
}

protected static function getAuthUser(): ?User
protected function getAuthUser(): ?User
{
return auth()->user();
}

protected static function getAuthId(): int|string|null
protected function getAuthId(): int|string|null
{
return auth()->id();
}

protected static function getAuthKey(): int|string|null
protected function getAuthKey(): int|string|null
{
return static::getAuthUser()?->getRouteKey();
return $this->getAuthUser()?->getRouteKey();
}

protected static function can(string $ability, mixed $arguments = []): bool
protected function can(string $ability, mixed $arguments = []): bool
{
return static::getAuthUser()->can($ability, $arguments);
return $this->getAuthUser()->can($ability, $arguments);
}

protected static function cannot(string $ability, mixed $arguments = []): bool
protected function cannot(string $ability, mixed $arguments = []): bool
{
return static::getAuthUser()->cannot($ability, $arguments);
return $this->getAuthUser()->cannot($ability, $arguments);
}
}

0 comments on commit 5a72bb0

Please sign in to comment.