0

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.

  • im struggling to understand but so far I've gotten to display just 1 image, this means the other responsive images are not being fetched; ```{{ $post->getFirstMediaUrl('thumbnails') }}``` this is how im doing. where you able to display your images, and were they responsive images? – Eduardo Aug 19 '23 at 02:57

3 Answers3

6

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

4

You should use:

php artisan storage:link
John Deck
  • 787
  • 1
  • 12
  • 27
1

Check your APP_URL and take care of the correct port.

  • Yes I checked it but the problem is still – mostafaamine briere Sep 12 '22 at 15:16
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Sep 16 '22 at 12:21