Skip to content
Advertisement

Laravel 5 not finding css files

I’ve just installed a Laravel 5 project on MAMP and my pages are not finding the css files.

This is the link to my css in my app.blade.php file:

JavaScript

And my .htaccess file has this line:

JavaScript

In the config folder my app.php file contains this:

JavaScript

But when I open up this page: http://localhost:8888/laravel-site/laravel-5-app/public/auth/login and check the developer tools, it is looking for the css file at this location: http://localhost:8888/css/app.css

Just as a side note, if I go to this url: http://localhost:8888/laravel-site/laravel-5-app/public/ I get the correct welcome page.

Advertisement

Answer

Use this to add assets like css, javascript, images.. into blade file.

FOR CSS,

JavaScript

OR

JavaScript

FOR JS,

JavaScript

OR

JavaScript

FOR IMAGES,

JavaScript

Here is the DOC

Alternatively, if you pulled the composer package illuminate/html which was come as default in laravel 4.2 then you can use like below, In laravel 5. you have to manually pull the package.

JavaScript

Here is an Example.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement