laravelurlviewhttp-status-code-404assets

Laravel URL::asset for 404's view


I'm embellishing Laravel's 404 page (ressources/views/erros/404.blade.php). But, I can't load my CSS and JS files, which are, in my public folder.

Actually, Laravel is returning me localhost/css/bootstrap.css when it should return me localhost/myproject/public/css/bootstrap.css with {{ URL::asset('css/bootstrap.css') }}. While it's returning me localhost/myproject/public/css/bootstrap.css when I'm on another view (with the same code: {{ URL::asset('css/bootstrap.css') }}) on my home page which is perfectly working.

By the way, I'm using Laravel 5.3.

Thanks in advance


Solution

  • Configure your webserver so the root of domain (localhost) points to public/ -folder.

    Vagrant-solution like Homestead would probably make setting up the development-environment easier for you.