Here I will demonstrate using a service container to retrieve data. implement simple error handling; add the first (logging) middleware.
- [Instructor] Now that our database is ready,…let's get into the code.…So we go back to our code and we have our default path…that we had before with the Hello name parameters.…Well now we can make a simple change and call this messages.…So now the route we are mapping is get messages,…just like we talked about earlier in the section.…Notice that we're not actually doing anything…with the request yet.…In fact, just to make that explicit, let's go ahead…and say This is our list of messages.…
So this is obviously not connecting to the database.…This is not doing any error handling.…This just shows to us that, yes, this is working…as expected.…So now when we come back to our browser,…and we change this path to messages,…we can see This is our list of messages.…That's exactly what we expect to happen.…But now we need to connect this to the database.…How do we go about that?…Well we need the database library to do that.…In this case, we'll use Laravel's Illuminate package.…
You could just as easily use ZenDB or Doctrine…
This course begins with a simple application specification and builds it one step at a time. Each chapter includes a key concept, with examples from other public APIs, and then shows how to build it yourself with Slim. Learn about URL routing, validating input, and generating response codes and hypermedia payloads. Like any project, the first implementation may be a little messy but don't worry. The last chapter covers refactoring and what it takes to scale and support the API going forward.
- Understanding the project goals
- Setting up the database
- Adding authentication in Slim
- Using cross-framework and authentication middleware
- Creating a read-write API in Slim
- Uploading files via the API
- Adding file security
- Creating payloads and response codes in Slim
- Scaling your API
Skill Level Beginner
PHP Date and Time Essential Trainingwith David Powers4h 31m Intermediate
Managing PHP Persistent Sessionswith David Powers2h 41m Intermediate
1. Project Explanation and Goals
2. Authentication Options and Tradeoffs
Cross framework middleware1m 32s
3. Create a Read-Write API
4. File Uploads via API
5. Scale Your API
Next steps1m 46s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.