FileUpload disk and storeFileNamesIn settings not working
Hey there. I'm using the following field configuration:
In my
config/filesystems.php
I have this configuration:
The problems are these:
1. The file does not get saved to the private directory, it gets saved to the app directory as if the 'local' disk was chosen
2. The storeFileNamesIn value never works, there is no document_filenames
in the data values.
Any ideas?7 Replies
1. Did you clear your cache?
2. Does the model allow fillable on odcument_filenames
1. Yes
2. I don't have the field or form hooked to a model, I'm manually handling the save. Maybe that's where the disconnect is? I see the livewire temporary file upload but Filament doesn't appear to be doing anything with it.
Can you provide the code you are using for the save/
Also worth noting, I'm only using the form builder, not the filament admin. Currently the save code just uses the Livewire file upload process and configuration since that seems to be what the form builder is delivering to me. This is a small part of a much larger process involving multiple models, hence the manual save method. Here's the relevant bit of the save code:
This works but I would expect there to be some sort of method I could call that would handle the file upload "the Filament way" that makes uses of the configuration I set on the component. The docs for using the Form Builder in a custom application make no note of how to handle the save without a model, though it seems implied that setting a model is optional.
1) 'document_filenames' needs to be casted as an array in the Model file
2) Have you linked the storage link for private?
php artisan storage:link
Lemme know if this helps
Aso you need to add the LINK in the config/filesystems.php
|
-> Since you are creating a custom disk. at the bottom of the file, add this in the links
Thanks, please see above. I'm not linking a model, I'm handling the save manually. I suppose my question can be boiled down to this:
If I am saving manually, do I have to use the Livewire TemporaryUploadedFile
->store()
method or is there a Filament way that makes use of the disk and visibility configuration I passed to the component?Are you calling getState() at the start of your form submission method?