|
1 | 1 | <?php
|
2 | 2 |
|
3 | 3 | // config for Statik/FilamentFlexibleBlocksAssetManager
|
| 4 | + |
4 | 5 | return [
|
5 | 6 | /*
|
6 | 7 | |--------------------------------------------------------------------------
|
|
21 | 22 | */
|
22 | 23 | 'navigation_group' => null,
|
23 | 24 |
|
| 25 | + /* |
| 26 | + |-------------------------------------------------------------------------- |
| 27 | + | Model & Resource |
| 28 | + |-------------------------------------------------------------------------- |
| 29 | + | |
| 30 | + | You can override the model and resource that are used. Be sure to inherit from our defaults. |
| 31 | + */ |
| 32 | + 'model' => \Statikbe\FilamentFlexibleBlocksAssetManager\Models\Asset::class, |
| 33 | + 'resource' => \Statikbe\FilamentFlexibleBlocksAssetManager\Filament\Resources\AssetResource::class, |
| 34 | + |
24 | 35 | /*
|
25 | 36 | |--------------------------------------------------------------------------
|
26 | 37 | | Image editor
|
|
90 | 101 | | Asset authorisation
|
91 | 102 | |--------------------------------------------------------------------------
|
92 | 103 | |
|
93 |
| - | The assets URLs can be protected. This can be done in different ways: |
94 |
| - | 1. a gate, see https://laravel.com/docs/11.x/authorization#gates |
95 |
| - | You can define a gate that takes the asset record as argument. |
96 |
| - | 2. a policy, see https://laravel.com/docs/11.x/authorization#writing-policies |
97 |
| - | You can write a policy for the Asset model. The `view` policy will be used to authorise. |
| 104 | + | The assets URLs can be protected and access to the Filament can be configured. |
| 105 | + | You need to define a new model policy and add an extra function for the public |
| 106 | + | file access of the asset. The name of this function needs to be added to the key |
| 107 | + | 'gate'. The policy class needs to be added to the key 'policy'. |
| 108 | + | The middleware is only used for assets URLs. You can get the assetId in the middleware by |
| 109 | + | calling $request->route('assetId') |
| 110 | + | |
| 111 | + | see https://laravel.com/docs/11.x/authorization#gates and |
| 112 | + | https://laravel.com/docs/11.x/authorization#writing-policies |
98 | 113 | */
|
99 | 114 | 'asset_authorisation' => [
|
100 | 115 | //'gate' => 'asset-access',
|
101 | 116 | //'policy' => AssetPolicy::class,
|
| 117 | + //'middleware' => AssetRedirectMiddleware::class, |
102 | 118 | ],
|
103 | 119 |
|
104 | 120 | /*
|
|
0 commit comments