slawek_n
slawek_n
FFilament
Created by ruff on 1/28/2024 in #❓┊help
FileUpload store path instead of filename
14 replies
FFilament
Created by ruff on 1/28/2024 in #❓┊help
FileUpload store path instead of filename
for me it looks like it should be working.
14 replies
FFilament
Created by ruff on 1/28/2024 in #❓┊help
FileUpload store path instead of filename
if above is not the way, afterStateUpdated and dehydrateStateUsing are your friends 😉
14 replies
FFilament
Created by ruff on 1/28/2024 in #❓┊help
FileUpload store path instead of filename
Then, field will expect the value to be uploads/someFile.jpg not someFile.jpg and will store it properly too.
14 replies
FFilament
Created by ruff on 1/28/2024 in #❓┊help
FileUpload store path instead of filename
filament uses Laravel storage, so assuming you use 'public' disk, you can go with:
FileUpload::make('image')
->image()
->disk('public')
->directory('uploads')
FileUpload::make('image')
->image()
->disk('public')
->directory('uploads')
https://filamentphp.com/docs/3.x/forms/fields/file-upload#configuring-the-storage-disk-and-directory
14 replies
FFilament
Created by ruff on 1/28/2024 in #❓┊help
FileUpload store path instead of filename
Can you elaborate more? In worst case scenario you can create separate field eg. path_relative and build its state to match your requirement. Take look https://filamentphp.com/docs/3.x/forms/fields/file-upload#generating-custom-file-names Maybe this will solve your case. Edit: fixed link
14 replies