Laravel-medialibrary: Thumb not displaying

Created on 17 Nov 2018  路  10Comments  路  Source: spatie/laravel-medialibrary

I have everything all set up and I see the url of the image if I inspect the image url http://localhost/storage/1/conversions/Jeery-thumb.jpg but this url is returning 404 on my browser when i navigate to this path. I then tried it with the port my laravel project was running on 8000 and then it showed localhost:8000/storage/1/conversions/Jeery-thumb.jpg How should this be handled ?

Most helpful comment

@yemilgr
I can reproduce this issue running my Laravel app via php artisan serve.

Having looked into this further I can see that the issue is caused due to the filesystems.php config in my Laravel install using env('APP_URL').'/storage' and my APP_URL in .env is set to http://localhost.

@pianistprogrammer
The solution is to change your APP_URL value to http://localhost:8000

All 10 comments

only thumb images are showing 404 or all images ???

all images....

Have you tried php artisan storage:link ??
I think this will solve the problem

did that already, I can see the storage folder in the public

@yemilgr
I can reproduce this issue running my Laravel app via php artisan serve.

Having looked into this further I can see that the issue is caused due to the filesystems.php config in my Laravel install using env('APP_URL').'/storage' and my APP_URL in .env is set to http://localhost.

@pianistprogrammer
The solution is to change your APP_URL value to http://localhost:8000

Any solution for this? I have the same problem. I am saving my images in public disk and I have run php artisan storage:link.
Code:
$p = Paciente::find(1);
$mediaItems = $p->getMedia();
$publicUrl = $mediaItems[0]->getUrl();
echo "<img src='" . $publicUrl . "' \>";

@carbontwelve Thank you my friend! This did the trick.

Was horizon running to generate the images behind the scenes?

I'll be closing this issue, if anyone comes up with a concrete error, feel free to drop a reply.

@yemilgr
I can reproduce this issue running my Laravel app via php artisan serve.

Having looked into this further I can see that the issue is caused due to the filesystems.php config in my Laravel install using env('APP_URL').'/storage' and my APP_URL in .env is set to http://localhost.

@pianistprogrammer
The solution is to change your APP_URL value to http://localhost:8000

Thank you. It worked for me

Please run this on cmd
php artisan storage:link

this is solve my problem

Was this page helpful?
0 / 5 - 0 ratings

Related issues

netanelwebninja picture netanelwebninja  路  3Comments

brendt picture brendt  路  4Comments

mokhosh picture mokhosh  路  3Comments

ideadx picture ideadx  路  4Comments

Krato picture Krato  路  4Comments