Is it possible to group SpatieMediaLibraryFileUpload files under a directory?
I am not sure if I am doing something wrong or directory method is just ignored. I would like to group my uploaded files to be in
products
directory. What are my options?
7 Replies
i dont think spatie supports this natively
whats the reason you want them in a directory?
collections are used for that normally
Just wanted to organise everything a little bit better instead of storing everything right in the root folder of the drive. It is easy with a default FileUpload but I guess I will need to write a CustomPathGenerator for the Spatie plugin (based on their docs) to customise this. It would have been nice if a simple
directory
organised files into sub-directory. Oh well. πYou probably should be able to define another disk that point to a directory and use it for spatie
Yes, you can specify a custom disk and/or use a custom PathGenerator to generate the exact path you want, see spatie documentation and config for more information
Yeh, that's what I have done exactly. π
Hi everyone
@Dan Harrin can you help me with this ? I'm trying to have a spatie media library in a popup from a page action like this.
where $this->record is the object with the data already
Could you please tell me what i'm missing to make it work ?
pass
->record()
OR ->model()
if the record exists then pass that and the files will be saved automatically.