Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

adding custom css/js files in laravel

Tags:

laravel-5

in laravel, which one is the proper way to add custom css & js files:

  • in public folder
  • in resource folder

I added my custom css/js files in resource folder but not working. But it works when I added my css and js files in public folder. Need a proper way to do that.

like image 943
rroy Avatar asked Apr 13 '26 07:04

rroy


1 Answers

You can either:

  1. Drag/drop them in the /public directory

  2. Place the file in the /resources directory, and in your build tool, copy the file(s)/directory(ies) from /resources to /public

If you use #1, be sure to add/include it the file(s) in your VCS.

Laravel has documentation on #2: https://laravel.com/docs/5.6/mix#copying-files-and-directories

like image 90
Kingsley Avatar answered Apr 18 '26 02:04

Kingsley