Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Laravel 5.x Cookbook

You're reading from  Laravel 5.x Cookbook

Product type Book
Published in Sep 2016
Publisher Packt
ISBN-13 9781786462084
Pages 402 pages
Edition 1st Edition
Languages
Authors (2):
Terry Matula Terry Matula
Profile icon Terry Matula
Alfred Nutile Alfred Nutile
Profile icon Alfred Nutile
View More author details

Table of Contents (17) Chapters

Laravel 5.x Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
1. Setting Up and Installing Laravel 2. Using Composer Packages 3. Routing 4. Building Views and Adding Style 5. Working with Data 6. Adding Angular to Your App 7. Authentication, Security, and Subscriptions 8. Testing and Debugging Your Application 9. Adding Advanced Features to Your App 10. Deploying Your App Index

Setting up Gulp and Elixir


Elixir is new in Laravel 5.x and is a wrapper around Gulp, which is a well-known JavaScript build system. We will use it to manage assets later on in the book. For now, we just want to get it installed.

How to do it...

  1. SSH into Homestead:

    >homestead ssh
    >cd ~/Code/recipes
  2. Install Gulp using the following:

    >npm install
  3. When it is done, try the following:

    > node_modules/gulp/bin/gulp.js -v

How it works...

Once again, Homestead is making our work easier; NPM is already installed! So, we can use this to not only install Gulp but also other JavaScript libraries that we need. How to do this? If you look into the Laravel application that we downloaded, you will now see the =package.json file:

This is the file that NPM uses, just as PHP uses composer.json, to know what to install. Here, it is getting Elixir, Gulp, and Sass for us. Elixir is new in Laravel 5.x and is a wrapper around Gulp, which is a well-known JavaScript build system.

Notice too that if you type which gulp, it is installed globally, thanks to Homestead again!

Elixir will come in later, but for now, note gulpfile.js that is right above the package.json file; this is where we will set up our asset workflow later on.

You have been reading a chapter from
Laravel 5.x Cookbook
Published in: Sep 2016 Publisher: Packt ISBN-13: 9781786462084
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}