I am new to Laravel and am trying to get the css in the public directory to load. The page loads no problem but the CSS gives me a 404 error in firebug:
\"Ne
If you install Illuminate/HTML you can do
{!!HTML::style('css/styles.css')!!} //styles.css inside public/css folder
or try
{{ asset('css/styles.css') }}
Try:
<link href="{{asset('css/main.css')}}" rel="stylesheet">
OR
<link href="{{url('css/main.css')}}" rel="stylesheet">
OR
If you are using php artisan serve its possible that your public folder is not being used, so use PHP native server instead and specify the public folder as the web root.
Stop artisan serve
and try using PHP native server by issuing this command at the root of your Laravel project: php -S localhost:8000 -t public
When you specify a path for your css and JS files, the root of the files need to be in 'project-name\public\' and not 'project-name\'
If you want for example to include with blade 'mytheme.css' which is inside 'mypersonalcss' folder ('mypersonnalcss\mytheme.css') fist add it to the project in 'project-name\public\mypersonnalcss\mytheme.css'
Then add it in your blade file :
<link href="{{ asset('mypersonnalcss\mytheme.css') }}" rel="stylesheet" type="text/css" >
Please see : Laravel 5 not finding css files to learn more about how to add assets to blade files.