Skip to content

Commit

Permalink
Update README.md to reflect Laravel 11
Browse files Browse the repository at this point in the history
  • Loading branch information
intrepidws authored Sep 2, 2024
1 parent 3175dac commit 5d33ee6
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,8 @@ class IncomeWidget extends LineChartWidget
#### Role Policy
You can skip this if have set the `'register_role_policy' => true` in the config.
##### Using Laravel 10
To ensure `RoleResource` access via `RolePolicy` you would need to add the following to your `AuthServiceProvider`:
```php
Expand All @@ -462,6 +463,24 @@ protected $policies = [
...
```
##### Using Laravel 11
To ensure `RoleResource` access via `RolePolicy` you would need to add the following to your `AppServiceProvider`:
```php
//AppServiceProvider.php
use Illuminate\Support\Facades\Gate;
...
public function boot(): void
{
...
Gate::policy(\Spatie\Permission\Models\Role::class, \App\Policies\RolePolicy::class);
}
...
```
**For both Laravel 10 and 11, you can skip this if have set the `'register_role_policy' => true` in the config.**
#### Third-Party Plugins
Shield also generates policies and permissions for third-party plugins and to enforce the generated policies you will need to register them in your application's `AuthServiceProvider`:
Expand Down

0 comments on commit 5d33ee6

Please sign in to comment.