Create a PHP REST API : Write a RESTful API from Scratch using Plain, Object-Oriented PHP and MySQL

preview_player
Показать описание
Learn how to develop a complete, RESTful API using plain, object-oriented PHP, MySQL and best practices.

Full API course, including authentication:

Please consider supporting my channel:

In this video you'll learn how to:
• create RESTful URLs
• list, show, create, update and delete database records using an API
• organise your PHP code
• use controllers and table gateways
• return relevant HTTP status codes
• validate data in an API
• decode and encode requests and responses as JSON

Code shown in the video:

Relevant documentation:

00:00 Introduction
00:18 API client
00:31 Front controller
01:38 RESTful endpoints
02:03 URL rewriting
03:03 HTTPie usage
03:28 Routing
03:59 404 response
04:23 Collection and resource URLs
05:19 Controller class
06:27 Class autoloading
08:19 Process the request
09:06 Collection requests
09:55 JSON Content-type
10:56 Create the database
11:53 Connect to the DB
14:08 Exception handling
16:44 Table gateway class
17:42 List all records
19:52 Encode JSON values
21:35 Insert a record
21:55 Get request data
27:04 201 response
28:00 Error handling
30:00 Data validation
31:46 422 response
32:28 405 response
33:36 Resource requests
34:43 Get a resource
35:59 404 response
37:02 Update a resource
40:03 Conditional validation
41:12 Delete a resource
43:12 Summary

#PHP #MySQL #REST #API
Рекомендации по теме
Комментарии
Автор

Out of interest, what data are you creating an API for?

dave-hollingworth
Автор

my php back end skills are archaic ... so before I dive in any api php framework I want to learn how to do it in plain PHP ... this tutorial is a blessing for me ...

zzzbyyy
Автор

Quite simply: the best php tutorial I have seen so far! Thank you for your crystal clear explanations.

manojphatak
Автор

I love how clearly you explain things. Please keep posting videos cause its really straight forward and help me learn a lot.

collenzaligway
Автор

hands-down one of the best coding tutorials I've seen, thank you, this helps me a lot

GenaroDesiaCoppola
Автор

One of the best tutorials I've seen, including paid ones. I really appreciate it and would love to see more.

william
Автор

Come on Dave, I am still feeling dizzy watching this Video. How can you be so good! Simply no daylight between you and PHP ! Am in awe.
Thank you so much, Dave. Sorry for myself trying to understand what you have taught so very well

NedumEze
Автор

Dude, you must be a pro! Thanks for such a detailed description. I'm actually amazed why there are so less comments and likes. You deserves a million of likes and subscribers. Subscribed!😊

vasurupolia
Автор

I came from Node and Python. Your tutorial pace very well and the content was concise, gave me the confidence to build one API server with PHP todday.

chieeyeoh
Автор

I've been searching for such amazing lesson for so long
thank you so much Dave .

med
Автор

Best PHP RESTful API Tutorial ever. Close the other tabs and stick to this one.

rodrodrigues
Автор

Very nice and modern PHP Crash course. Absolutely awesome. Thanks 🙏

ademineshat
Автор

Thanks a lot. This is genuinely one of the best tutorials I've ever watched

AhmedHuzain
Автор

undoubtedly, one of the best PHP API instructors... full stop... subscribed

muhammadsharif
Автор

This is great! Perfect amount of explanation. I still have to dig in as I dont have PHP experience and this was exactly what I needed. great job!

dobrinivanov
Автор

I've started working with htmx recently and like that I don't have to work with json for the most part :)
Still, this is a nice tutorial to set up a basic system to receive requests.

NoahNobody
Автор

The tuitorial was perfect. Very invaluable 🏆🏆🏆

shadrackkipkoech
Автор

thanks a lot! this is exactly what I was looking for, you explained everything really well, now I can go ahead and make my project

jayk
Автор

Well-explained source for learning APIs using PHP.
Thanks for your efforts ❤

fakh
Автор

thats it! i'm officially done w/ .net 😁 many txs

efbYouTube
welcome to shbcf.ru