© Paul Redmond 2016

Paul Redmond, Lumen Programming Guide, 10.1007/978-1-4842-2187-7_9

9. Authors

Paul Redmond

(1)Phoenix, Arizona, USA

So far your /books endpoint provides an author column on the books database table. Making authors a string field on the books table was intentional so that you could focus on other primary concepts of building your API, but now you are ready to create proper author data and provide API endpoints for author data.

This chapter will cover the following:

  • Creating the authors database schema

  • Creating a relationship between book data and authors

  • Creating API endpoints for author information

  • Modifying your /books endpoint to use new author data

The Authors Database Schema

Creating the authors database table involves a few migrations: ...

Get Lumen Programming Guide: Writing PHP Microservices, REST and Web Service APIs 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.