laravellaravel-8laravel-9laravel-filament

images not showing using spatie media library in filamentphp


I am having trouble displaying the images uploaded using spatie media library with the filament admin panel.

image for clarificatio

This is the code for form schema :

SpatieMediaLibraryFileUpload::make('thumbnail')->collection('posts')

And this is the code for table columns

SpatieMediaLibraryImageColumn::make('thumbnail')->collection('posts')

Thanks.


Solution

  • Check in your .env (root folder of your laravel project) file that the APP_URL is the same as your server url. You get the server url on startup (php artisan server) mine is http://127.0.0.1:8000. (or http://localhost:8000)

    So you fill in from APP_URL=http://127.0.0.1 and change to APP_URL=http://127.0.0.1:8000 If you have localhost fill in APP_URL=http://localhost:8000

    Check if the files are uploaded to your storgae and been linked with your public folder. In your CLI: php artisan storage:link