Laravel does not load images

mettyugfx ・

Aug 17th, 2022 11:29 AM

Hi I do have some issue with laravel, it does not load images and other assets like JS and css

mikemastercorp ・

Aug 17th, 2022 05:50 PM

Hello mettyugfx.

If you could share some code used to show images or load libs we might be able to give you a hand.

If, for example, you put a file test.txt in /public/test of your project and try to link to the files directly in your blade view file using the code below:

<script src="{{ asset('test/test.txt') }}"></script>

what is happening and can you see in the sources the file as well as to view its content by clicking on it?

If the images are not showing, you are most likely not having linked your storage to the public. If that is the case, you can easily fix it using the command:

php artisan storage:link

Without enough shared info, so much I can guess today so feel free to share the outcome and if it does not work, please be more specific if you would like some decent answers ;)

Good luck