Why image uploaded with spatie-laravel-media-library-plugin not found under storage?

172 Views Asked by At

On laravel 10 / filamentphp 3 site I have added spatie-laravel-media-library-plugin and upoading file with comnponent :

SpatieMediaLibraryFileUpload::make('image')
    ->disk('local')
    ->preserveFilenames(),

I see row in media table and file is uploaded under /ProjectRoot/storage/app/app_media/5/ subdirectory, but in browser I see that 404 error is returned on

http://local-host.com/storage/app_media/5/wizdom.jpg

url

I found valid file under

file:///ProjectRoot/storage/app/app_media/5/wizdom.jpg

path

but

/ProjectRoot/public/storage/

subdirectory is empty.

I run several times commands

cd public
rm storage
cd ../
php artisan storage:link

INFO  The [public/storage] link has been connected to [storage/app/public].

With output above that link was created with success.

How that can be fixed ?

"laravel/framework": "^10.35.0",
"filament/filament": "^3.0-stable",
"filament/spatie-laravel-media-library-plugin": "^3.1",
"spatie/laravel-medialibrary": "^10.15.0",

Thanks in advance!

0

There are 0 best solutions below