Node / NPM to manage JS / CSS in Laravel
To manage your js and css files in Laravel you could place your js and css files in the public directory, but using the /resources/assets folder you can add your js and css (sass or less, etc) in there.
You then need to compile these with nodejs and NPM. To install nodejs / npm on Ubuntu you can use
sudo apt-get install nodejs
Once installed in a terminal window navigate to your Laravel project directory and type:
node install
Once that’s done you can view the file package.json.
These are the js and css files that node manage for this project. Each of the script names can be run using npm.
Eg, in my test Laravel site part of this file says:
John is a freelance PHP developer. Experienced in PHP, Laravel and WordPress he can code anything you need.
From Alberton, Gauteng I am available for PHP, Laravel or WordPress freelance jobs in Johannesburg, Pretoria, Cape Town, Port Elizabeth. I also often do remote PHP freelance work all over South Africa and the rest of the world.