Book Image

Laravel 5.x Cookbook

By : Terry Matula, Alfred Nutile
Book Image

Laravel 5.x Cookbook

By: Terry Matula, Alfred Nutile

Overview of this book

Laravel is a prominent member of a new generation of web frameworks. It is one of the most popular PHP frameworks and is also free and an open source. Laravel 5 is a substantial upgrade with a lot of new toys, at the same time retaining the features that made Laravel wildly successful. It comes with plenty of architectural as well as design-based changes. The book is a blend of numerous recipes that will give you all the necessary tips you need to build an application. It starts with basic installation and configuration tasks and will get you up-and-running in no time. You will learn to create and customize your PHP app and tweak and re-design your existing apps for better performance. You will learn to implement practical recipes to utilize Laravel’s modular structure, the latest method injection, route caching, and interfacing techniques to create responsive modern-day PHP apps that stand on their own against other apps. Efficient testing and deploying techniques will make you more confident with your Laravel skills as you move ahead with this book. Towards the end of the book, you will understand a number of add-ons and new features essential to finalize your application to make it ready for subscriptions. You will be empowered to get your application out to the world.
Table of Contents (17 chapters)
Laravel 5.x Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Launching Gulp watch into your workflow


As we saw previously, it is super handy to have Travis CI running tests as you push to GitHub. But it is actually pretty slow to wait so long to see whether your tests are passing; better to run it locally before you push. But who can remember to do this? Well, with Gulp, we will see no need to remember it, just run it!

Getting ready

SSH into Homestead using the command homestead ssh and cd into the recipe directory. Then, let's get going.

How to do it...

  1. Take a moment to run npm install from within the app directory.

    Tip

    This will take a few minutes! Go get some coffee and welcome to NPM!

  2. While this is running or after it is done, edit gulpfile.js, and make it look as follows:

  3. Then, run gulp watch.

  4. Start editing it:

    1. Edit MarvelApiClientTest.php, and add an example unit test:

      Simple test to show gulp working

    2. Then, you will see something like this at your command line:

    3. Then, go edit app/MarvelApi.php, and click on save. Go check out the console, and you will see...