4

i try to add bootstrap and external css file into my laravel project using two methods

<link rel="stylesheet" href="../../assets/css/scrolling-nav.css">

                                 and
<link rel="stylesheet" href="{{ URL::asset('css/scrolling-nav.css') }}" />

both way but it shows error on console. my directory structure is as shown in image please help me get out from this problem.

1
  • place your files in public folder then try.. Commented Dec 26, 2016 at 8:20

2 Answers 2

3

Always place your js/css files in public folder.In your case try like this.Make whole copy of assets folder inside public folder..

For Stylesheet..

 <link rel="stylesheet" type="text/css" href="{{url('assets/css/bootstrap.min.css')}}"/> 

And For JS file..

<script src="{{url('assets/js/components/bootstrap.js')}}"></script>
Sign up to request clarification or add additional context in comments.

1 Comment

that was my mistake
0

Usually you're keeping app assets in resources/assets directory and using Elixir to concatinate, minify and copy assets to a public directory.

If you're not familiar with Elixir and Gulp, you can just put your assets to a public directory and load them with:

<link rel="stylesheet" href="{{ asset('css/scrolling-nav.css' }}">

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.