This is my directory structure.
-resources
-css
-mycss.css
-js
-myjs.js
-myimagesfolder
-views
-admin
-home.blade.php
how can i access resources>css>mycss.css , resources>js>myjs.js and resources>mymagesfolder>images in my views>admin>home.blade.php.
Put your css and js file inside public folder like this:
-public
-css
-mycss.css
-js
-myjs.js
Now you can access your files like this.Putthis below line of code inside head tag
For css
<link rel="stylesheet" href="{{asset('css/mycss.css')}}">
For Js
<script src="{{asset('js/myjs.js')}}"></script>
According to Laravel official documents link, files under /resources/css, /resources/js need be compiled before use.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With