Chapter 3. Routing

In this chapter, we will cover the following topics:

  • Building an API / JSON based route for searching
  • Testing your route in PHPUnit
  • Building a view based route
  • Testing your view based route in PHPUnit
  • Creating named routes

Introduction

In this chapter, we will cover routing. One thing, in my opinion, that makes a great framework is easy-to-use routing. When I first started in Laravel, coming from Drupal and then Rails, I was really glad to see how easy it is to try ideas in a route and quickly see results.

We will cover testing your routes, API based routes, and naming. By the time you are done I think you will see just how easy routing is in Laravel.

Get Laravel 5.x Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.