Let's Build an API using Slim PHP Framework
Coding Reflections
This video shows you how to build an API using the Slim PHP microframework. The API allows you to add, delete, modify, and fetch the details of cricket players via JSON HTTP requests. We'll also implement data validation, authentication, and error handling using middlewares.
GitHub repo link: https://github.com/iabhinavr/slim-php-app
0:00 Intro 1:53 Installing Composer 5:53 Starting with the index.php file 8:38 Setting up the server 16:13 Installing Postman 17:50 Adding Routes 19:18 Connecting to the Database 22:25 Routes continued... 23:22 Using DBAL for Database Queries 27:42 Understanding Dependency Injection 31:03 Route to get all players 32:22 Route to get a single player 34:50 Route to add a new player 35:33 Getting input data using Body Parser Middleware 41:41 Route to update a player 44:23 Route to delete a player 45:43 Authentication 54:40 Request data validation 1:01:05 Handling Errors 1:03:10 Storing credentials in dotenv file 1:05:51 Final Notes
Website: https://codingreflections.com
Server providers: Linode: https://codingreflections.com/go/linode/ DigitalOcean: https://codingreflections.com/go/digitalocean/
Disclaimer:
This video is based on my personal experiences and knowledge. There is no guarantee that the information shared is 100% accurate.
Disclosure:
This video and its description may contain affiliate links, which can earn us commission if someone purchases products using those links. ... https://www.youtube.com/watch?v=atA_z-ilyNg
188823829 Bytes