directory method of Filament doesn't work

Viewed 19

I'm using Laravel and for admin panel Filament on my website.

I also used Spatie media library to upload files on Cloudinary , as I set Laravel disk to Cloudinary.

Here is the code that is making a file input on the admin panel for Articles part.

Section::make('imsge')->schema([
   Forms\Components\SpatieMediaLibraryFileUpload::make('image')
   ->disk('cloudinary')
   ->required()
   ->image()
   ->directory('Elite Shop/blog')
   ->maxFiles(1)
   ->label('')
])->collapsible(),

Here I used directory method to specify the directory that files have to be uploaded there. As Filament documentation says:

To change the disk and directory that files are saved in, and their visibility, use the disk(), directory() and visibility methods

But it doesn't work! Spatie is still uploading files in the root folder of Cloudinary like this:

1/filename.jpg

Although I want the path to be like this:

Elite Shop/blog/1/filename.jpg
0 Answers
Related