apsonex/filament-simple-file

Filement Simepl File Uploader

v1.0.9 2023-11-09 21:17 UTC

This package is auto-updated.

Last update: 2024-10-19 19:10:22 UTC


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)