REST API with PHP and MySQL | Full Slim PHP Micro Framework Tutorial

  Рет қаралды 7,147

Dave Hollingworth

Dave Hollingworth

Күн бұрын

In this PHP project, you'll learn how to create a REST API using the Slim micro framework.
Please consider supporting my channel:
☕ ko-fi.com/davehollingworth
Topics covered:
• Slim basics
• Using third-party packages in Slim
• Dependency Injection
• Middleware
• Slim controllers
• Slim configuration
All source code shown is free to download:
‣ github.com/daveh/slim-rest-ap...
Links shown in the video:
‣ www.slimframework.com/
‣ www.apachefriends.org/
‣ getcomposer.org/
‣ www.postman.com/downloads/
‣ httpie.io/
‣ www.php-fig.org/psr/psr-11/
‣ php-di.org/
‣ packagist.org
‣ github.com/vlucas/valitron
Videos:
‣ Securely Storing PHP Configuration Settings:
• Securely Storing PHP C...
‣ How to set up a virtual host in Apache (WAMP, MAMP, XAMPP)
• How to set up a virtua...
00:00 Introduction
00:48 Install Slim
02:04 Hello world
04:29 Running Slim
06:02 Start API
07:17 Use API client
07:43 Return JSON
08:22 Get database data
09:37 Create database class
11:23 Autoloading
12:32 Create repository class
14:35 Dependency injection
16:54 DI container entries
19:57 Slim URL variables
21:40 Alternative Slim routing
22:52 Get product record
25:55 Slim middleware
27:13 Response middleware
29:06 Request middleware
31:56 Single method controllers
34:15 Multiple method controllers
35:44 New record endpoint
38:03 Insert data
40:38 Validation
42:38 Update data endpoint
45:18 Delete data endpoint
46:55 Method not allowed
47:22 Refactoring and route groups
49:46 Summary
#PHP #slim #project #api #restapi

Пікірлер: 45
@dave-hollingworth
@dave-hollingworth Ай бұрын
Part 2, adding API key authentication is here: kzbin.info/www/bejne/rGbXcpegm5Wiaac
@jackke8586
@jackke8586 8 күн бұрын
I have already purchased three courses by Dave on Udemy. He is truly amazing, and the content he provides is both clear and useful.
@dave-hollingworth
@dave-hollingworth 8 күн бұрын
Thank you so much for the super thanks, I really appreciate it!
@stephenmitchell603
@stephenmitchell603 3 ай бұрын
Thanks for this tutorial David. You explain concepts in simple, digestible chunks, and proceed through each topics with clarity and logic. I enjoy watching your tutorials and always come away with stronger comprehension of the subject material.
@dave-hollingworth
@dave-hollingworth 3 ай бұрын
Thank you so much for your kind words and super thanks Stephen, I really appreciate it!
@truthteachers
@truthteachers 3 ай бұрын
For me it did not sound simple or digestible as i feel we need a good understanding of DI and Containers as a perquisite. The footprint may be small but the framework is too confusing for a solution developers like me. I would rather stick to Codeigniter and make my life simple as it provides a wholesome package. So i am unable to comment the value of the course as I feel the course is running with the assumption that we already know Slim framework.
@maiwald
@maiwald 2 ай бұрын
Hey Dave, thanks for this! A very well produced and very informative video. I have not worked with PHP in the last 15 years or so, but with PHP hosting being dead cheap in Germany, this tutorial makes me consider going back for a small API project.
@dave-hollingworth
@dave-hollingworth 2 ай бұрын
Thank you so much for your support!
@anmarm.9487
@anmarm.9487 3 ай бұрын
I been looking for a decent tutorial on Slim... thanks
@gorgeouxpanjira8894
@gorgeouxpanjira8894 2 ай бұрын
the best of slim framework tutorial
@ErisPorty
@ErisPorty Ай бұрын
Thank you
@NoahNobody
@NoahNobody 3 ай бұрын
Great choice for a tutorial.
@crazyingenieur3277
@crazyingenieur3277 3 ай бұрын
Excellent video!
@jediampm
@jediampm 2 ай бұрын
Hi, great explanation. thanks. ;)
@8bitcomputers_hu
@8bitcomputers_hu 2 ай бұрын
Thanks for this tutorial!
@dave-hollingworth
@dave-hollingworth 2 ай бұрын
Thank you so much for your support!
@expresscoding3525
@expresscoding3525 3 ай бұрын
Please make a full-fledged Slim Course with a production grade API for let's say E-commerce, because Slim is a framework and provides more security, also it could be using Symfony, but a good project which is real-world would be much more useful .
@efbYouTube
@efbYouTube 3 ай бұрын
EXCELLENT as always! & txs 4 taking the time to break out the sections esp on these longer vids; makes it so much easier to later ref! love these recent vids using frameworks pckgs & libraries but have concerns on how well they will work in the shared host environments. r there web hosts that u can recommend that can accommodate them
@dave-hollingworth
@dave-hollingworth 3 ай бұрын
This one in particular works well on shared hosting - this is my current recommended host: davehollingworth.com/go/hosting
@efbYouTube
@efbYouTube 3 ай бұрын
@@dave-hollingworth awesome! i'll give em a try!
@evekaykay
@evekaykay 3 ай бұрын
Superb explanation skills. A symfony version of this would be super cool and also a deployment video on how to put all this code into azure or aws using a git repo.
@patrik_trejtnar
@patrik_trejtnar Ай бұрын
thank you!
@dave-hollingworth
@dave-hollingworth Ай бұрын
Thank you so much!
@KGB1st
@KGB1st 2 ай бұрын
101 like) Good job! Perfect speech and correct explonation of the material!!! I'm starting to learn slim, and can't found better guide.. p.s. notfoundexception returned by default already
@dave-hollingworth
@dave-hollingworth 3 ай бұрын
Complete API course, including authentication: davehollingworth.net/phpapisy
@birsingh5388
@birsingh5388 3 ай бұрын
Good work
@alalyrealestate1136
@alalyrealestate1136 3 ай бұрын
Is it up to date?
@dave-hollingworth
@dave-hollingworth 3 ай бұрын
@@alalyrealestate1136 Yes
@alalyrealestate1136
@alalyrealestate1136 3 ай бұрын
@@dave-hollingworth Is there is laravel course on udemy?
@weavekpanko148
@weavekpanko148 2 ай бұрын
Does it include use of slim configuration setup on windows
@emmanuelomotayo9177
@emmanuelomotayo9177 Ай бұрын
Good job! I would like you to share on how to deploy the slim restapi to a live server like heroku, Aws, azure or shared host like hostgator
@dave-hollingworth
@dave-hollingworth Ай бұрын
Thanks for the idea!
@zainkhalid3670
@zainkhalid3670 3 ай бұрын
Hey Dave, Yesterday I had to recommend a beginner level web dev course (HTML, CSS, JS, PHP, MYSQL only) to my brother. I was looking for a course that taught from scratch avoiding unnecessary in-depth details for beginners and yet still manage to produce a respectable project. I could not find a single instance on all of KZbin. Either the courses were super in depth & disjoint or too advanced. It'll be great if you could fill in such a course.
@dave-hollingworth
@dave-hollingworth 3 ай бұрын
Ok thank you for the suggestion, I'm working on a PHP for Beginners course right now!
@alalyrealestate1136
@alalyrealestate1136 3 ай бұрын
Thnky you Dave for every thing, I already joined in two courses on udemy "php" and "mvc", and i wonder do you have advanced php course at the same quality as these? and thanks again 👌
@dave-hollingworth
@dave-hollingworth 3 ай бұрын
Thank you for taking my courses! I don't have an advanced course more than the PHP MVC one yet, but I'm working on it!
@davidsondavid4988
@davidsondavid4988 3 ай бұрын
can you make an E-commerce website where u can buy with mobile, credit card, gifts, and bank accounts. Thank you.
@veralyons6219
@veralyons6219 3 ай бұрын
Thank you for this video🎉 Please can you make a video about why PHPMailer takes over 5 minutes to send a message .... Singular dynamic, plain text btw
@dave-hollingworth
@dave-hollingworth 3 ай бұрын
It's most likely the SMTP server - SMTP servers are slow anyway, as SMTP is a "chatty" protocol. Alternatives are to use a queue and process it later, or use an email sending API
@veralyons6219
@veralyons6219 3 ай бұрын
@@dave-hollingworth That's great, thanks
@koriehakim9188
@koriehakim9188 2 ай бұрын
Promo_SM
RESTful API на чистом PHP
1:01:15
AreaWeb
Рет қаралды 90 М.
Don’t take steroids ! 🙏🙏
00:16
Tibo InShape
Рет қаралды 61 МЛН
Can You Draw The PERFECT Circle?
00:57
Stokes Twins
Рет қаралды 86 МЛН
Uma Ki Super Power To Dekho 😂
00:15
Uma Bai
Рет қаралды 59 МЛН
Omega Boy Past 3 #funny #viral #comedy
00:22
CRAZY GREAPA
Рет қаралды 9 МЛН
Stop Calling Your API a "REST API"
17:42
Amichai Mantinband
Рет қаралды 13 М.
Using PHP Check Email ID Already Exist Or Not in Database
5:13
PHP Technical & Framework
Рет қаралды 25 М.
PHP doesn't suck (anymore)
10:48
Aaron Francis
Рет қаралды 192 М.
Dependency Injection, The Best Pattern
13:16
CodeAesthetic
Рет қаралды 725 М.
tRPC, gRPC, GraphQL or REST: when to use what?
10:46
Software Developer Diaries
Рет қаралды 66 М.
Build a RESTFUL API with SlimPHP
28:42
Tyler Potts
Рет қаралды 27 М.
Laravel First Impressions From A JavaScript Dev
21:08
adamdotdev
Рет қаралды 113 М.
Fastest Frameworks? Speed Comparison for Popular PHP Frameworks
5:20
Carregando telefone com carregador cortado
1:01
Andcarli
Рет қаралды 1,6 МЛН
Power up all cell phones.
0:17
JL FUNNY SHORTS
Рет қаралды 47 МЛН
Трагичная История Девушки 😱🔥
0:58
Смотри Под Чаёк
Рет қаралды 355 М.
😱НОУТБУК СОСЕДКИ😱
0:30
OMG DEN
Рет қаралды 2,1 МЛН