© Paul Redmond 2016

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

10. The /authors API Resource

Paul Redmond

(1)Phoenix, Arizona, USA

In this chapter, you are going to build on the last chapter’s introduction to the authors table. You will start working on API endpoints for your dedicated Author resource! At this point, you should be familiar with the basics of defining routes and working with controllers. Reference Chapter 4 and Chapter 5 to get a refresher as needed.

The author endpoint will provide API endpoints for getting author details and the books they’ve authored. Along the way I will show you a really cool feature of Fractal that allows you to include associated transformer data in a response; this means you can easily ...

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.