bbecker48/codeigniter4-eloquent

Simple integration of Laravel Eloquent ORM into CodeIgniter 4 via Composer.

Maintainers

Package info

github.com/bbecker48/codeigniter4-eloquent

pkg:composer/bbecker48/codeigniter4-eloquent

Transparency log

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-08-26 12:27 UTC

This package is auto-updated.

Last update: 2026-08-26 12:44:21 UTC


README

Simple integration of the Laravel Eloquent ORM into CodeIgniter 4 via Composer.

The package automatically initializes Eloquent when a CodeIgniter application starts. No additional service or event configuration is required in your project.

Requirements

  • PHP 8.2 or later
  • CodeIgniter 4.5 or later
  • MySQL or MariaDB
  • Composer

Installation

From the root directory of your CodeIgniter 4 project, run:

composer require bbecker48/codeigniter4-eloquent

Eloquent and its dependencies will be installed automatically.

Database configuration

Configure your database connection in the CodeIgniter .env file:

database.default.hostname = localhost
database.default.database = my_database
database.default.username = root
database.default.password =
database.default.DBDriver = MySQLi

The package automatically uses the CodeIgniter database configuration to initialize Eloquent.

Create an Eloquent model

Create your models in app/Models.

Example:

<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Book extends Model
{
    public $timestamps = false;
}

You can then use Eloquent directly from your controllers:

use App\Models\Book;

$book = Book::find(1);

echo $book->title;

All standard Eloquent features can be used, including queries, relationships, collections and CRUD operations.

How it works

The package integrates illuminate/database with the CodeIgniter lifecycle and automatically boots Eloquent when the application starts.

You do not need to modify:

  • app/Config/Services.php
  • app/Config/Events.php
  • your CodeIgniter core files

Documentation

License

This package is open-sourced software licensed under the MIT License.