Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why use npm with laravel?

As npm is the package manager for node, I frequently see it used with laravel boilerplate projects, but I can't reason why?

For example, this laravel-5-boilerplate instructs to npm install within the steps of installing the project..

Other examples too can be found of using npm with laravel..

Can someone please explain to me?

like image 405
Samir Sabri Avatar asked May 20 '15 12:05

Samir Sabri


People also ask

What is the use of npm in Laravel?

While Laravel does not dictate which JavaScript or CSS pre-processors you use, it does provide a basic starting point using Bootstrap and Vue that will be helpful for many applications. By default, Laravel uses NPM to install both of these frontend packages.

What is the purpose of using npm?

npm is the world's largest Software Registry. The registry contains over 800,000 code packages. Open-source developers use npm to share software. Many organizations also use npm to manage private development.

Why we use node js in Laravel?

Laravel: It is a PHP framework that is free and open-source enabling developers to use the pattern of MVC in the development needs. NodeJS: It is a JavaScript Runtime Environment that is used for Cross-Platform development needs.

Do I need node JS for Laravel?

If you need a full-scale system to handle a massive website that is based on CMS, go with Laravel. If you need a service-based architecture that is compact, go with Node JS. Laravel platform contains the Eloquent ORM, which requires a basic implementation of PHP Active Record.


2 Answers

Nowadays npm containing general tools for work with various front-end tasks. So, it's very useful to grab some packages from it. In case of laravel, there is two utilities, that it uses:

gulp - streaming building tool for concatenating, minifing your css,js code.

laravel-elixir - is wrapper for gulp, written by Jeffrey Way, who is doing laracasts for us. It's place where you can found out more about this this tool in particular and in common.

If you will use only standart js/css, you can pass this step.

like image 113
vanadium23 Avatar answered Sep 30 '22 18:09

vanadium23


Blockquote

I made that boilerplate. That command is specific to download the dependencies for the Laravel Elixir package (http://laravel.com/docs/5.0/elixir) But has many, many uses outside that.

The Elixir docs explain it very well.

like image 37
Anthony Avatar answered Sep 30 '22 17:09

Anthony