From the course: Building RESTful APIs in Laravel
Unlock the full course today
Join today to access over 24,800 courses taught by industry experts.
Challenge: Building the author resource
From the course: Building RESTful APIs in Laravel
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
-
-
-
-
-
Using API resources to display all petitions6m 5s
-
(Locked)
Saving a new petition2m 24s
-
(Locked)
Displaying a specific petition2m 52s
-
(Locked)
Updating an existing petition2m 17s
-
(Locked)
Deleting a petition4m 27s
-
(Locked)
Challenge: Building the author resource1m 8s
-
(Locked)
Solution: Building the author resource2m 25s
-
-
-