PHP REST API Tutorial: with PHP OOPS, PDO, UNIT Testing, JWT, CURD, EXAMPLES

PHP REST API Tutorial: with PHP OOPS, PDO, UNIT Testing, JWT, CURD, EXAMPLES

What’s REST API or RESTFUL API?

What’s JWT?

HOW JWT Token look like?

JWT Token and Details

We will be creating a very simple REST API using

- PHP Programming Language with Object Oriented Concept
- PDO Library
- Mysql Database
- JWT Auth
- Unit Tetsing

Create a RESTful web service for a Book.

- (C)reate a new Book
- (R)ead existing Books
- (U)pdate an existing Book
- (D)elete an existing Book

Prerequisites

- PHP Installation
- Mysql Installation
- Composer Installation
- Local Apache Server UP

How to Start?

Files and Folders

Basic testing done for all functions like create, update, read & delete book

Ready to test, let’s go-ahead with testing using POSTMAN

What all Endpoints are available for test?

- Sign-in for auth token - 'sign_in'
- (C)reate a new Book - 'create_book'
- (R)ead existing Books - 'read_book'
- (U)pdate an existing Book - 'update_book'
- (D)elete an existing Book - 'delete_book'

Open Your POSTMAN

Lets test?

Create Book

Read Book

Read Book By Id

Update Book

Delete Book

Connect @ linkedin

Technology Enthusiast/ CTO/ Product Owner/ Connectivity Specialist/ API / Backend Development/ AI & ML, Prof: https://www.linkedin.com/in/travel-technology-cto/