My laravel 5.2 app unable to fetch the stylesheet from the public/css directory on the production server but can fetch stylesheets on the local machine!
here is how I am linking my files:
<link href="{{asset('css/clock.css')}}" rel="stylesheet" media="all" />
I also tried bunch of different ways:
<link href="{{URL::asset('css/clock.css')}}" rel="stylesheet" media="all" />
OR:
{{HTML::style('css/clock.css')}}
but nothing worked on server!
but it is not able to fetch the css! when I check the page source, it shows me some other css file linked.. is it because of '.htaccess' file that I used to redirect to the public folder of my site?
you can have a look at enter link description here..
please help!
The asset() helper prepends the base URL to the path you supply. But laravel keep js, css, and image files into public folder so you need to add public path like this:
href="public/{{ asset('css/style.css') }}.
Instead of doing this edit into this file:-
vendor\laravel\framework\src\Illuminate\Foundation\helpers.php
Why are u not trying url helper like this
Note:- css/clock.css is in public folder