open source guy
open source guy

Reputation: 2787

Assets files not loading in laravel?

i am using Laravel 4 my base url is http://localhost/messifan/fms/laravel/public/

my css in public/css/barcelona.css

browser trying to load this URL

http://localhost/messifan/fms/laravel/public/css/barcelona.css

i am using this code in view to load css

<?php echo URL::asset('css/barcelona.css'); ?>

I get this error trying to open http://localhost/messifan/fms/laravel/public/css/barcelona.css

enter image description here

Upvotes: 1

Views: 8569

Answers (2)

Homme Sauvage
Homme Sauvage

Reputation: 1916

The problem could be on your htaccess or permissions.

Try to temporarily remove htaccess and try to access directly the css file. If the problem persists then you should try to chmod public/css folder and the files in to 777 and try again.

Check again the path to the css file and its name.

Upvotes: 2

kJamesy
kJamesy

Reputation: 6233

Try

<?php echo HTML::style('css/barcelona.css'); ?>

Edit PS: This will load the styles. To access the path to the file, you don't need to do much! well, unless you want to put the link to it in your view:

<a href="<?php echo URL::asset('css/barcelona.css'); ?>">The CSS File</a>

Upvotes: 1

Related Questions