apsonex / filament-simple-file
Filement Simepl File Uploader
v1.0.9
2023-11-09 21:17 UTC
Requires
- php: ^8.2
- enshrined/svg-sanitize: ^0.16.0
- filament/filament: ^3.0
- illuminate/contracts: ^9.0|^10.0
- intervention/image: ^2.7
- spatie/laravel-package-tools: ^1.16
- spatie/temporary-directory: ^2.1
Requires (Dev)
- nunomaduro/collision: ^7.8
- orchestra/testbench: ^8.10
- pestphp/pest: ^2.18
- pestphp/pest-plugin-arch: ^2.3
- pestphp/pest-plugin-laravel: ^2.2
README
Usage
use \Apsonex\FilamentSimpleFile\Form\Components\File File::make('column') ->disk('s3') ->directory("storage/dir/location") ->visibility('public') ->acceptedFileTypes(['image/png', 'image/jpeg', 'image/jpg']) ->helperText('Helper Text') ->maxSize(5 * 1024) ->label('Upload Logo');
Delete previously stored file
To delete previously stored file, use deleteOldFile(true)
. Make sure Form component implement getRecord()
method and must return model instance.
File::make('column') ->disk('s3') ->deleteOldFile(true)