So far, we have understood what a RESTful web services. We have also seen the new features in PHP7 which will make our code better and cleaner. Now, it is time to implement RESTful web services in PHP. So, this chapter is all about implementation.
We have seen an example of a blog having blog posts and comment endpoints. In this chapter, we will implement those endpoints. Here are the topics that we will cover:
- Creating REST API for a blog in PHP
- Creating a database schema
- Blog user/author table schema
- Blog post table schema
- Blog post comments schema
- Creating REST API's endpoint
- Code structure
- Common components
- Creating blog post endpoints
- To do
- Creating a database schema
- Visible flaws
- Validation
- Authentication
- Proper 404 pages
- Summary