I am developing a Laravel project. It is under 5.7 Laravel version. I am using Homestead as a local development environment. When I run any route in the project, it doesn’t load public assets. instead, it gives 404 error. see attached image below.
I coded correctly on getting assets path
{{ asset("public/js/frontend/jquery.min.js") }}
but all these assets are existing in the project folder. and when i try to go any of those assets, it gives laravel’s 404 error.see below image.
It would be great if anyone can give me a solution for this. Thanks in advance.
2
Answers
As suggested by @Douwe de Haan you don’t have to use the public part, just call
You shouldn’t write public directory to asset function
Also,
https://laravel.com/docs/5.8/helpers#method-asset