Learn About API testing with REST Assured | Devstringx

Back to Blog
Codeigniter 4 With JWT

Learn About API testing with REST Assured | Devstringx


Step1: Install the composer

Step2: Install the Codeigniter 4

There are two ways to install the Codeigniter 4

Way 1:

create-project codeigniter4/app starter codeigniter4POC

Way 2:

Visit the below link and download the Codeigniter 4 structure


Step3: run composer update from the project root terminal

Step4: create a token from your Github account

codeigniter 4

Click on the link and generate the token from there.

Restful Api Crud

Past the token in the terminal and press enter

Step4: Start the server

Run command the “PHP spark serve”

Step5: create model “ PHP spark make: model post”

Step6: create a table

Step7: connect to database config/database.php

Step8: create controller by PHP spark make: controller Post — restful

Read Also:- How to Install Codeigniter 4

Step9: create the routes for the API’s in config/routes.php

Step10: past the below code in post controller

Step11: run the command from the root of the project

“PHP spark serve”

How to use the custom helper in the Codeigniter


Note: reference documentation

— use of model to communicate with database


— How to use the Query builder


Share this post

Back to Blog