Learn About API testing with REST Assured | Devstringx

Back to Blog
Codeigniter 4 With JWT

Learn About API testing with REST Assured | Devstringx

Installation:-

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

https://codeigniter.com/download

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 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

Step1:

Note: reference documentation

— use of model to communicate with database

https://codeigniter.com/user_guide/models/model.html#finding-data

— How to use the Query builder

https://codeigniter.com/user_guide/database/query_builder.html

Share this post

Back to Blog