PHPackages                             onlyphp/codeigniter3-model - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. onlyphp/codeigniter3-model

ActiveLibrary[Database &amp; ORM](/categories/database)

onlyphp/codeigniter3-model
==========================

Advanced model class for CodeIgniter 3 with eager loading and pagination capabilities

1.1.13(10mo ago)075MITPHPPHP &gt;=8.0

Since Jan 1Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/faizzul95/Codeigniter3Model)[ Packagist](https://packagist.org/packages/onlyphp/codeigniter3-model)[ RSS](/packages/onlyphp-codeigniter3-model/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (23)Used By (0)

Advanced MY\_Model for CodeIgniter 3 🚀
======================================

[](#advanced-my_model-for-codeigniter-3-)

[![Latest Version](https://camo.githubusercontent.com/1922b98db3aa07dbabb64e624c00226b98117af97ae6fe8bbba5797ed096ba77/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f6e6c797068702f636f646569676e69746572332d6d6f64656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/onlyphp/codeigniter3-model)[![Total Downloads](https://camo.githubusercontent.com/1bdf8b9f639e29fb67f114e500d90ec918fe510a9e1b92792b0792356cae49ae/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f6e6c797068702f636f646569676e69746572332d6d6f64656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/onlyphp/codeigniter3-model)[![License](https://camo.githubusercontent.com/5ed0b57f0c957fd683f8f07e3d2890e57ba0c4665106c7151bfde8e61f7267e7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6f6e6c797068702f636f646569676e69746572332d6d6f64656c2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

A powerful extension of CodeIgniter 3's base Model class that brings modern ORM features to your CI3 applications. This package introduces Laravel-style eloquent features, advanced query capabilities, and robust database interaction layers while maintaining CodeIgniter's simplicity.

⚠️ Warning
----------

[](#️-warning)

**DO NOT USE THIS PACKAGE IN PRODUCTION**

This package is under active development and may contain critical bugs. It is primarily intended for personal use and testing. The current version has not undergone rigorous testing and may be unstable.

📝 Requirements
--------------

[](#-requirements)

- PHP &gt;= 8.0
- CodeIgniter 3.x
- `MySQL` Database

Add this line in `composer.json` before install or update.

```
"scripts": {
    "post-install-cmd": [
        "@php vendor/onlyphp/codeigniter3-model/scripts/install.php"
    ],
    "post-update-cmd": [
        "@php vendor/onlyphp/codeigniter3-model/scripts/update.php"
    ]
}
```

🔧 Installation
--------------

[](#-installation)

```
composer require onlyphp/codeigniter3-model
```

✨ Key Features
--------------

[](#-key-features)

- 🔄 **Laravel Eloquent-style Query Builder**: Write expressive and chainable database queries like laravel
- 🔗 **Smart Relationship Handling**: Define and manage model relationships effortlessly
- 🚀 **Eager Loading**: Solve the N+1 query problem with efficient data loading
- 🛡️ **Security Layer**: XSS protection and output escaping
- ♻️ **Soft Deletes**: Safely handle record deletion with recovery options
- ✅ **Automatic Validation**: Built-in validation when creating or updating records
- 📝 **Advanced Pagination**: Flexible pagination with AJAX support
- 🎯 **Raw Query Support**: Execute complex custom SQL when needed
- 📦 **Batch Operations**: Efficient handling of multiple records

📚 Basic Model Configuration
---------------------------

[](#-basic-model-configuration)

Here's a complete example of how to set up your model with all available configurations:

```
