generated from filamentphp/plugin-skeleton
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfilament-flexible-blocks-asset-manager.php
129 lines (118 loc) · 4.75 KB
/
filament-flexible-blocks-asset-manager.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
<?php
// config for Statik/FilamentFlexibleBlocksAssetManager
return [
/*
|--------------------------------------------------------------------------
| Translatable assets
|--------------------------------------------------------------------------
|
| Allows to translate the assets in different languages.
*/
'translatable_assets' => true,
/*
|--------------------------------------------------------------------------
| Navigation group
|--------------------------------------------------------------------------
|
| Sets the navigation group label to which the assets table is added. Or if you use translations, set it in this
| translation key: filament-flexible-blocks-asset-manager.navigation_group
*/
'navigation_group' => null,
/*
|--------------------------------------------------------------------------
| Model & Resource
|--------------------------------------------------------------------------
|
| You can override the model and resource that are used. Be sure to inherit from our defaults.
*/
'model' => \Statikbe\FilamentFlexibleBlocksAssetManager\Models\Asset::class,
'resource' => \Statikbe\FilamentFlexibleBlocksAssetManager\Filament\Resources\AssetResource::class,
/*
|--------------------------------------------------------------------------
| Image editor
|--------------------------------------------------------------------------
|
| Enables the image editor. You can set preset aspect ratios, the editor mode of Cropper.js, and the default
| viewport size.
| see https://filamentphp.com/docs/3.x/forms/fields/file-upload#setting-the-image-editors-mode
*/
'image_editor' => [
'enabled' => false,
'aspect_ratios' => [
null,
'16:9',
'4:3',
'1:1',
],
'mode' => 1, // see https://github.com/fengyuanchen/cropperjs#viewmode
'empty_fill_colour' => null, // e.g. #000000
'viewport' => [
'width' => 1920,
'height' => 1080,
],
],
/*
|--------------------------------------------------------------------------
| Accepted file types
|--------------------------------------------------------------------------
|
| Sets the file type validation, use an array of mime types.
| see https://filamentphp.com/docs/3.x/forms/fields/file-upload#file-type-validation
*/
'accepted_file_types' => [
//'application/pdf'
],
/*
|--------------------------------------------------------------------------
| Storage disk
|--------------------------------------------------------------------------
|
| The file system disk in which the assets will be stored.
*/
'storage_disk' => null,
/*
|--------------------------------------------------------------------------
| Storage directory
|--------------------------------------------------------------------------
|
| The directory on the file system disk in which the assets will be stored.
*/
'storage_directory' => null,
/*
|--------------------------------------------------------------------------
| Storage visibility
|--------------------------------------------------------------------------
|
| The visibility of the assets, see Spatie Medialibrary docs.
*/
'storage_visibility' => 'public',
/*
|--------------------------------------------------------------------------
| Asset authorisation
|--------------------------------------------------------------------------
|
| The assets URLs can be protected and access to the Filament can be configured.
| You need to define a new model policy and add an extra function for the public
| file access of the asset. The name of this function needs to be added to the key
| 'gate'. The policy class needs to be added to the key 'policy'.
| The middleware is only used for assets URLs. You can get the assetId in the middleware by
| calling $request->route('assetId')
|
| see https://laravel.com/docs/11.x/authorization#gates and
| https://laravel.com/docs/11.x/authorization#writing-policies
*/
'asset_authorisation' => [
//'gate' => 'asset-access',
//'policy' => AssetPolicy::class,
//'middleware' => AssetRedirectMiddleware::class,
],
/*
|--------------------------------------------------------------------------
| Asset route prefix
|--------------------------------------------------------------------------
|
| You can change the start of the route path by setting this config.
| Do not add a slash as the last character this will be added automatically.
*/
'asset_route_prefix' => '/asset',
];