PHPackages                             agungsugiarto/codeigniter4-eloquent - 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. agungsugiarto/codeigniter4-eloquent

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

agungsugiarto/codeigniter4-eloquent
===================================

The Illuminate Database package for CodeIgniter 4

v2.0.1(4y ago)264.5k10[3 issues](https://github.com/agungsugiarto/codeigniter4-eloquent/issues)MITPHPPHP ^7.3|^8.0

Since Aug 4Pushed 4y ago2 watchersCompare

[ Source](https://github.com/agungsugiarto/codeigniter4-eloquent)[ Packagist](https://packagist.org/packages/agungsugiarto/codeigniter4-eloquent)[ RSS](/packages/agungsugiarto-codeigniter4-eloquent/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (7)Dependencies (5)Versions (10)Used By (0)

The Illuminate Database package for CodeIgniter 4
=================================================

[](#the-illuminate-database-package-for-codeigniter-4)

[![Latest Stable Version](https://camo.githubusercontent.com/a15c3c58099f9053a2afae40990d3167002172c52c39e213a27845ccefe4bc16/68747470733a2f2f706f7365722e707567782e6f72672f6167756e67737567696172746f2f636f646569676e69746572342d656c6f7175656e742f76)](https://packagist.org/packages/agungsugiarto/codeigniter4-eloquent)[![Total Downloads](https://camo.githubusercontent.com/890eec3d42aa23df9abcd77d023b00b8e6d8a3f84f062a39d0d335b9da39b500/68747470733a2f2f706f7365722e707567782e6f72672f6167756e67737567696172746f2f636f646569676e69746572342d656c6f7175656e742f646f776e6c6f616473)](https://packagist.org/packages/agungsugiarto/codeigniter4-eloquent)[![Latest Unstable Version](https://camo.githubusercontent.com/748093ae29264722a73db3dcf8ea30f89ff5c03304485240fa4fd95ba3a0a1f4/68747470733a2f2f706f7365722e707567782e6f72672f6167756e67737567696172746f2f636f646569676e69746572342d656c6f7175656e742f762f756e737461626c65)](https://packagist.org/packages/agungsugiarto/codeigniter4-eloquent)[![License](https://camo.githubusercontent.com/4d09481ac3d02cf1e6d7215f9f2296a508362b18f22253357429799d3437d8d6/68747470733a2f2f706f7365722e707567782e6f72672f6167756e67737567696172746f2f636f646569676e69746572342d656c6f7175656e742f6c6963656e7365)](https://packagist.org/packages/agungsugiarto/codeigniter4-eloquent)

Update from v1.x to 2.x
-----------------------

[](#update-from-v1x-to-2x)

just simple publish config eloquent with command

```
php spark eloquent:publish
```

Instalation
-----------

[](#instalation)

Include this package via Composer:

```
composer require agungsugiarto/codeigniter4-eloquent
```

Publish config
--------------

[](#publish-config)

```
php spark eloquent:publish
```

Costuming view pagination
-------------------------

[](#costuming-view-pagination)

The default view for pagination available with preset for bootstrap4 and basic html, if you want to costumize just copy from `\vendor\agungsugiarto\codeigniter4-eloquent\src\Views\Bootstrap4.php` and modify with your style after that put on folder App\\Views. Finnaly change your config in `App\Config\Eloquent.php`

Setup services eloquent
-----------------------

[](#setup-services-eloquent)

Open App\\Controllers\\BaseController.php

add `service('eloquent');` on function initController

```
//--------------------------------------------------------------------
// Preload any models, libraries, etc, here.
//--------------------------------------------------------------------
// E.g.:
// $this->session = \Config\Services::session();

service('eloquent');
```

Usage
-----

[](#usage)

Example model

```
