humzayunas's avatar

How to add custom css and js files

I want to add my custom js and css files to laravel project . Version of laravel is 5.6. But when ever i add css and js files to public without processing. I call them using asset function but when ever i do this i get error that resouce not found . What can be the issue

0 likes
7 replies
cre3z's avatar

you are using this? make sure that your file is in the correct location public/css/plugins.css

<link rel="stylesheet" href="{{ asset('css/plugins.css') }}">

or have you tried the relative path?

<link rel="stylesheet" href="/css/plugins.css">

humzayunas's avatar

@cre3z I have tried all this . I see errors in console with 404 for all resources loaded like this

humzayunas's avatar

Yes i have checked all the urls and everything is normal as it should be in public directory as i'm accessing app.css from public directory that is compiled

bobbybouwmann's avatar

Are you sure you placed your files in the public/css directory and do they still exists there?

You can also open the url of the css file and it should show you the content in the browser. For example http://mysite.com/css/style.css

1 like

Please or to participate in this conversation.