Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix path to middleware #3

Merged
merged 3 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ $user->attachRole(Role::hasLabel('admin')->first());
$user->detachRole(Role::hasLabel('leader')->first());
```

If you add the `RodrigoPedra\LaravelSimpleACL\Http\Middleware\LoadSimpleACL` middleware
If you add the `\RodrigoPedra\LaravelSimpleACL\Http\Middleware\LoadSimpleACL` middleware
to your middleware stack, you can use Laravel's gate to check for permissions:

```php
Expand Down
4 changes: 2 additions & 2 deletions src/Concerns/HasACL.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,12 @@ public function loadACLCache(): void
{
$this->setRelation(
'roles',
Cache::rememberForever($this->makeACLCacheKey('roles'), static fn () => $this->roles()->get()),
Cache::rememberForever($this->makeACLCacheKey('roles'), fn () => $this->roles()->get()),
);

$this->setRelation(
'permissions',
Cache::rememberForever($this->makeACLCacheKey('permissions'), static fn () => $this->permissions()->get()),
Cache::rememberForever($this->makeACLCacheKey('permissions'), fn () => $this->permissions()->get()),
);
}

Expand Down