From the course: Building RESTful APIs in Laravel

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Challenge: Building the author resource

Challenge: Building the author resource

From the course: Building RESTful APIs in Laravel

Start my 1-month free trial

Challenge: Building the author resource

(upbeat music) - [Instructor] In the previous challenge, I asked you to create the various author files. In this challenge, I'd like you to fill the authors database table with the name string fields, migrate the database, add the name fields to the fillable array on the author model, create author factory, and seed database with 10 different authors using the fakest name property. Once you do this, return the author collection in the index method of the author controller, add an author resource in the show method of the author controller. Before we continue, as you can probably tell, there is one too many relationship between a petition and an author. A petition has one author but an author can have many petitions. We will not implement any relationships in this course. So for the purpose of this challenge assume that author is an independent resource. Have a go. And if you find yourself unsure how to continue,…

Contents