CI 4 Insert Rows in Bulk

In case if we want to insert rows in bulk then we have a method available in CodeIgniter 4 which we call via Model object.

# Load model

use App\Models\StudentModel;

# Creating model instance

$object = new StudentModel();

# Insert Rows
$object->insertBatch([ [], [], [], ... ]);
StudentModel.php

Above code will insert rows in bulk inside associated table for StudentModel.

Read more