How to add css and js in laravel 5

How to add css and js file in laravel 5 is very easy now –

There are several ways to add the css and js links in Laravel 5+

FOR CSS,

<link href=”{{ asset(‘css/style.css’) }}” rel=”stylesheet” type=”text/css” >
OR

<link href=”{{ URL::asset(‘css/style.css’) }}” rel=”stylesheet” type=”text/css” >
FOR JS,

<script type=”text/javascript” src=”{{ asset(‘js/main.js’) }}”></script>
OR

<script type=”text/javascript” src=”{{ URL::asset(‘js/main.js’) }}”></script>
FOR IMAGES,

{{ asset(‘img/profile.jpg’); }}

Check it also 

Go for Laravel Documentation

 

Leave a Reply

Your email address will not be published. Required fields are marked *