How to add Foreign key in migration – CodeIgniter 4

In a database, a foreign key is a field that references another table.

They keep track of related records and which table they exist in. They also let you know what record they relate to, which means updating them is simple and quick.

In this tutorial, I show how you can add a foreign key while creating table using migration in CodeIgniter 4.

How to add Foreign key in migration - CodeIgniter 4

Read more

What is Database Seeding in CodeIgniter 4?

Database seeding is a way of populating a database with test data that can be used for initial testing to explore the various functions of your application instead of having to create test users one by one every time you want to test something new.

In CodeIgniter 4 database seeding feature is available.

This post guides you through the creation of database seeding and running single or multiple seeding files in CodeIgniter 4.

What is Database seeding in CodeIgniter 4?

Read more

How to create Helper function and use it in Laravel

A Helper function is a small piece of code that performs a specific task or operation and can be used anywhere in your application.

In Laravel you need to create a new PHP file to write Helper functions and specify the file path in the composer.json file.

In this article, you will learn how to create Helper functions in Laravel and how to use it.

How to Create and Use Helper function in CodeIgniter 4

Read more

How to add pagination using Yajra Datatables in Laravel 9

DataTables is a jQuery library for implementing pagination.

For adding AJAX pagination needs to write a long script that – count total records with and without filters, fetch records, initialize Array with data, and return the JSON array with required fields.

In Laravel, there is a Yajra DataTables package that makes this pagination process a little easier to implement.

How to add pagination using Yajra Datatables in Laravel 9

Read more