FileUpload::make()->directory('my/secret/sauce') Don't save full URL in DB

I have an existing DB, that stores just the file name for image_loc.
'user1.png' is in my DB. Now when I create a new record, image_loc = 'my/secret/sauce/filename.ext' which is how filament is saving the image location to the DB. 1.) Can I get it to just save the filename? 2.) If one is possible, What option do I need to FileUpload::make() to force it to use 'my/secret/sauce' as a path instead of just assuming it is in the database field ? Thanks,
Solution:
Found a solution that worked for me. Used Laravel to do this. Just created a new disk using Laravel that was the direct path I wanted. This solved all the issues I was having, no longer does the file name have the directory structure appended to it, and I don't need to change any paths....
Jump to solution
2 Replies
awcodes
awcodes2mo ago
If you don’t provide a ->directory() it should just be the file name. Although by default it will be a hash instead of the file name so you’d have to use the preserve file names options too.
Solution
Jonathan
Jonathan2mo ago
Found a solution that worked for me. Used Laravel to do this. Just created a new disk using Laravel that was the direct path I wanted. This solved all the issues I was having, no longer does the file name have the directory structure appended to it, and I don't need to change any paths.
Want results from more Discord servers?
Add your server
More Posts