Building an API / JSON based route for searching

In Chapter 6, Adding Angular to Your App we will cover Angular and in there I needed to make an API for the widget to talk to. Let's review that again here in more detail.

Getting ready

A fresh install of Laravel will do.

How to do it...

Follow the steps to build an API / JSON route for searching:

  1. Add our controller:
    > php artisan make:controller SearchComics
    
  2. Add our route:
    How to do it...
  3. Fill in the controller:
    How to do it...
  4. And in the ComicClientInterface class, I handle the comics method like this. I will go into more details in the ...

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.