Serge Alkhalil
Serge Alkhalil

Reputation: 37

Including external css and JS files in Laravel 5

I have made a programme using JavaScript and some styling using CSS I wish now to add a login system to make it more secure. I have made the login system using Laravel 5. The issue I am having is when I import the files. I am getting this error:

http://127.0.0.1:8000/js/jquery-3.5.1.min.js net::ERR_ABORTED 404 (Not Found)

for all of my JavaScript and CSS files. All of my JS and CSS files are in the views folder is this the correct place for them to be? or do I need to do something else?

Also, I have tried to use these:

<link rel="stylesheet" href="{{ asset('stylesheet.css') }}" />
<link rel="stylesheet" href="{{ URL::asset('stylesheet.css') }}" />
<link rel="stylesheet" href="{{ URL::to('stylesheet.css') }}" />
<link rel="stylesheet" href="{{ url('stylesheet.css') }}" />

They didn't work. I am guessing that the issue is a routing issue? Can someone help me to fix this?

Upvotes: 0

Views: 92

Answers (1)

Enver Arslan
Enver Arslan

Reputation: 749

All assets must be in public folder where your app root directory. https://laravel.com/docs/7.x/structure#the-public-directory

Upvotes: 1

Related Questions