You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-6Lines changed: 4 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -26,17 +26,15 @@ You must also [prepare your Eloquent model](https://spatie.be/docs/laravel-media
26
26
27
27
## Form component
28
28
29
-
You may use the field in the same way as the [original file upload](https://filamentphp.com/docs/forms/fields/file-upload) field:
29
+
You may use the field in the same way as the [original file upload](https://filamentphp.com/docs/forms/file-upload) field:
30
30
31
31
```php
32
32
use Filament\Forms\Components\SpatieMediaLibraryFileUpload;
33
33
34
34
SpatieMediaLibraryFileUpload::make('avatar')
35
35
```
36
36
37
-
The media library file upload supports all the customization options of the [original file upload component](https://filamentphp.com/docs/forms/fields/file-upload).
38
-
39
-
> The field will automatically load and save its uploads to your model. To set this functionality up, **you must also follow the instructions set out in the [setting a form model](https://filamentphp.com/docs/forms/adding-a-form-to-a-livewire-component#setting-a-form-model) section**. If you're using a [panel](../panels), you can skip this step.
37
+
The media library file upload supports all the customization options of the [original file upload component](https://filamentphp.com/docs/forms/file-upload).
By default, files will be uploaded publicly to your storage disk defined in the [Filament configuration file](https://filamentphp.com/docs/forms/installation#publishing-configuration). You can also set the `FILAMENT_FILESYSTEM_DISK` environment variable to change this. This is to ensure consistency between all Filament packages. Spatie's disk configuration will not be used, unless you [define a disk for a registered collection](https://spatie.be/docs/laravel-medialibrary/working-with-media-collections/defining-media-collections#content-using-a-specific-disk).
52
+
By default, files will be uploaded publicly to your storage disk defined in the [Filament configuration file](https://filamentphp.com/docs/forms/installation#publishing-configuration). You can also set the `FILESYSTEM_DISK` environment variable to change this. This is to ensure consistency between all Filament packages. Spatie's disk configuration will not be used, unless you [define a disk for a registered collection](https://spatie.be/docs/laravel-medialibrary/working-with-media-collections/defining-media-collections#content-using-a-specific-disk).
55
53
56
54
Alternatively, you can manually set the disk with the `disk()` method:
57
55
@@ -159,8 +157,8 @@ It's possible to target a file upload component to only handle a certain subset
159
157
For example, you could scope the field to only handle media that has certain custom properties:
160
158
161
159
```php
160
+
use Filament\Schemas\Components\Utilities\Get;
162
161
use Filament\Forms\Components\SpatieMediaLibraryFileUpload;
0 commit comments