A publishing house wants to create a web app to manage their content (publishing, editing, etc). As part of their database setup, there is an articles table in the database which has columns (id, title, description, status, created_by, created_at). The created_by is a foreign key that references the admin table with columns (id, name, email_address, created_at).
Articles are created by an admin and new articles have a default status value of unpublished.
As the Tech resource of the publishing house you have been tasked with creating;
- An endpoint to create a new article.
- An endpoint to update an existing article.
- An endpoint to delete an existing article.
- An endpoint to publish an unpublished article.
- An endpoint to show all published articles
- An endpoint to retrieve just a single article
- The response for 3 above should be
{
"status": "success",
"message": "This article was successfully deleted"
}
- The response for others (1,2,4 - 6) should be similar to the
Example Response as seen here
- Submit your code and create a
.txt file and place the link to the documentation there Here's a guide on how to create an API documentation
- Note, you are not to push the following along your code :
vendor, composer.lock and .env. Kindly place then in a .gitignore file. For .env file, push a .env.sample file instead
A publishing house wants to create a web app to manage their content (publishing, editing, etc). As part of their database setup, there is an
articlestable in the database which has columns(id, title, description, status, created_by, created_at). Thecreated_byis a foreign key that references theadmintable with columns(id, name, email_address, created_at).Articles are created by an admin and new articles have a default status value of
unpublished.As the Tech resource of the publishing house you have been tasked with creating;
Example Responseas seen here.txtfile and place the link to the documentation there Here's a guide on how to create an API documentationvendor,composer.lockand.env. Kindly place then in a.gitignorefile. For.envfile, push a.env.samplefile instead