lundi 24 août 2015

How to link external CSS and Script (assets) in Laravel 5.1 project

Hi guys am new to Laravel and this is my first project to do in laravel, I had trouble linking my assets(CSS & Js) file on my views.. I did a research an found if I will use {{URL::asset('assets/plugins/bootstrap/css/bootstrap.min.css')}} in Laravel 5.1 it will work. I did succeed when it was just a single link, but when I add other links..

<link rel="stylesheet" href="{{URL::asset('assets/plugins/animate.css')}}">
<link rel="stylesheet" href="{{URL::asset('assets/plugins/line-icons/line-icons.css')}}">
<link rel="stylesheet" href="{{URL::asset('assets/plugins/parallax-slider/css/parallax-slider.css')}}">
<link rel="stylesheet" href="{{URL::asset('assets/css/custom.css')}}">

The server denied the access to all files in assets folder Access forbidden!. My .htaccess file code is..

<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>
RewriteEngine On

# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>

Question is if .htaccess file had a problem why when I put one asset link it accept? Or what is the proper way of linking the files? Am using XAMPP as my local server. *Guy I just learned Laravel yesterday so be easy on me... Thanks in advance



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1PvWjtO
via IFTTT

Aucun commentaire:

Enregistrer un commentaire