Laravel 5.x Cookbook

Book description

A recipe-based book to help you efficiently create amazing PHP-based applications with Laravel 5.x

About This Book

  • Leverage the amazing new features of Laravel 5.x to create cutting-edge responsive PHP applications.
  • Create apps with interoperability features and extend these features to your existing applications as well.
  • Over 60 recipes that combine tried and tested Laravel tips for getting your app working.

Who This Book Is For

The ideal target audience for this book is PHP developers who have some basic PHP programming knowledge. No previous experience with Laravel is required for this book.

What You Will Learn

  • Optimize Your Gulp and Elixir Workflow
  • Use Travis to run tests with every push
  • Build and test your view-based route in PHPUnit
  • Explore workflows for migrations and seeding
  • Implement Angular in your Laravel applications
  • Set up a user authentication system
  • Integrate the new Billing library and Stripe in your Laravel application
  • Use the Artisan command-line tool
  • Test your App in Production with Behat

In Detail

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.

Style and approach

This book will have a practical recipe-based approach with dedicated recipes on your daily Laravel tasks (as well as on more advanced issues) that will help you become a pro with Laravel 5.x

Table of contents

  1. Laravel 5.x Cookbook
    1. Table of Contents
    2. Laravel 5.x Cookbook
    3. Credits
    4. About the Author
    5. About the Reviewer
    6. www.PacktPub.com
      1. eBooks, discount offers, and more
        1. Why Subscribe?
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Sections
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. There's more…
        5. See also
      5. Conventions
      6. Reader feedback
      7. Customer support
        1. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    8. 1. Setting Up and Installing Laravel
      1. Introduction
      2. Setting up Homestead
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
        5. See also
      3. Setting composer and PHP on your local machine for faster Workflows
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
        5. See also
      4. Setting up your first application in Homestead
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
      5. Using .env for your local build
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
      6. Using sequel pro and connecting to local and remote databases
        1. How to do it...
        2. How it works...
        3. See also
      7. Setting up Gulp and Elixir
        1. How to do it...
        2. How it works...
        3. See also
    9. 2. Using Composer Packages
      1. Introduction
      2. Working with Composer install command and avoiding Composer update
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
        5. See also
      3. Making a provider
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
      4. Using the Facade pattern
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
      5. Using private packages
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
    10. 3. Routing
      1. Introduction
      2. Building an API / JSON based route for searching
        1. Getting ready
        2. How to do it...
        3. How it works…
        4. See also
      3. Testing your route in PHPUnit
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. See also
      4. Building a view based route
        1. Getting ready
        2. How to do it…
        3. How it works…
      5. Testing your view based route in PHPUnit
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. See also
      6. Creating named routes
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. See also
    11. 4. Building Views and Adding Style
      1. Introduction
      2. Organizing your Blade files
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
      3. Installing a WrapBootStrap theme
        1. Getting Started
        2. How to do it…
        3. How it works…
        4. See also
      4. Making your authentication pages
        1. How to do it…
        2. How it works…
      5. Implementing an error message template
        1. Getting started…
        2. How to do it…
        3. How it works…
      6. Building your main search page
        1. Getting started…
        2. How to do it…
        3. How it works…
        4. See also
      7. Adding a static page
        1. Getting started…
        2. How to do it…
        3. How it works…
    12. 5. Working with Data
      1. Introduction
      2. Setting up users and running migrations
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
      3. Altering a migration
        1. Getting ready
        2. How to do it....
        3. How it works…
        4. See also
      4. Using factories for migrations and tests
        1. Getting ready
        2. How to do it…
        3. How it works…
          1. See also
      5. Using a generator to scaffold your user wishlist area
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. See also
      6. Seeding so you can see how your app looks
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. See also
      7. Adding a file upload to user profile
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. See also
      8. Validating the file upload
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. See also
      9. Saving files to S3
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. See also
    13. 6. Adding Angular to Your App
      1. Introduction
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
      2. Adding Angular search to our search page
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. See also
      3. Handling Angular and Ajax requests
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. See also
      4. Paginating our Angular results
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. See also
      5. Testing an Angular page with Behat
        1. Getting ready
        2. How to do it...
        3. How it works…
        4. See also
      6. Creating a relationship with favorites
        1. Getting ready
        2. How to do it…
        3. How it works…
          1. See also
      7. Building a favorites Ajax widget in Angular
        1. Getting ready
        2. How it works…
        3. How to do it…
        4. See also
      8. Validating incoming input
        1. Getting ready
        2. How to do it…
        3. How it works…
          1. See also
      9. Using the CORS protection
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. See also
      10. Using Elixir and Gulp to set up Angular
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
    14. 7. Authentication, Security, and Subscriptions
      1. Introduction
      2. Using policies and guard to protect user pages
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
      3. Adding feature flags to hide features from users
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. See also
      4. Implementing Socialite to allow users to login with Facebook
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. See also
      5. Adding custom middleware to protect user admin area
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. See also
      6. Using Laravel to set up a subscription site
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. See also
      7. Creating an interface for the user to manage subscriptions
        1. Getting ready
        2. How to do it…
        3. How it works…
      8. Creating an admin interface for subscriptions
        1. Getting ready
        2. How to do it…
        3. How it works…
    15. 8. Testing and Debugging Your Application
      1. Introduction
      2. Generating tests
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. There's more...
        5. See also
      3. Using tests to think through your code TDT (Test Driven Thinking)
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
      4. Getting your code onto GitHub
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
      5. Using VCR for API testing
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
      6. Using Travis to run tests with every push
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
      7. Launching Gulp watch into your workflow
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
      8. Using mockery to test your controllers
        1. Getting ready
        2. How to do it...
        3. How it works…
        4. See also
      9. Troubleshooting your application
        1. Getting ready
        2. How to do it…
        3. How it works…
    16. 9. Adding Advanced Features to Your App
      1. Introduction
      2. Building an Artisan command
        1. Getting ready
        2. How to do it...
        3. How it works...
        4. See also
      3. Creating scheduler to notify users of new comics
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. See also
      4. Setting up e-mail notices
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. See also
      5. Adding clean URLS for the users profile page
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. See also
      6. Using pusher for live notifications
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. See also
      7. Adding a blog area to update users on new features
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. See also
    17. 10. Deploying Your App
      1. Introduction
      2. Setting up Forge, AWS, and CodeDeploy
        1. Getting ready
        2. How to do it...
        3. How it works…
        4. See also
      3. Setting up Travis to auto deploy when all is passing
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. See also
      4. Working with your .env file
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. See also
      5. Testing your app on Production with Behat
        1. Getting ready
        2. How to do it…
        3. How it works…
        4. See also
      6. Making a composer package out of our client
        1. Getting ready
        2. How to do it…
        3. How it works…
    18. Index

Product information

  • Title: Laravel 5.x Cookbook
  • Author(s): Alfred Nutile
  • Release date: September 2016
  • Publisher(s): Packt Publishing
  • ISBN: 9781786462084