0

So I have a view that the css and js is not loading:

The controller:

 return view('home.news')
                ->with("news", $news);

the route:

Route::get('/news/{id}', ['as'=>'home.news','uses'=>'HomeController@news']);

And I have used asset to get the data from css and js

css:

<link rel='icon' sizes="16x16" href="icon/favicon-icon.png" type='image/x-icon'>
<link rel="stylesheet" href="{{asset('node_modules/bulma/css/bulma.min.css')}}" type="text/css">
<link rel="stylesheet" href="{{asset('node_modules/swiper/css/swiper.min.css')}}">
<link rel="stylesheet" href="{{asset('node_modules/@fortawesome/fontawesome-free/css/all.min.css')}}">
<link rel="stylesheet" href="{{asset('styles/packages.css')}}" type=" text/css">
<link rel="stylesheet" href="{{asset('styles/general.css')}}" type=" text/css">
<link rel="stylesheet" href="{{asset('styles/jquery-ui.css')}}" type=" text/css">
<link href="https://unpkg.com/[email protected]/dist/aos.css" rel="stylesheet">
@yield("css")

js:

<script src="{{asset('node_modules/swiper/js/swiper.min.js')}}"></script>
<script src="{{asset('js/swipers.js')}}"></script>
<script src="{{asset('js/navbar.js')}}"></script>
<script src="{{asset('js/jquery.js')}}"></script>
<script src="{{asset('js/jquery-ui.js')}}"></script>
<script src="https://unpkg.com/[email protected]/dist/aos.js"></script>

<script type="text/javascript">
  AOS.init();
</script>

Any help would be appreciated, Thank you!

2

1 Answer 1

1

probably it's because wrong path for your files. your css and js folders should be inside the public folder of your laravel project. if it's not working yet you can replace "asset" with "url".

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.