Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/agungsugiarto/codeigniter4-eloquent
The Illuminate Database package for CodeIgniter 4
https://github.com/agungsugiarto/codeigniter4-eloquent
codeigniter4 codeigniter4-eloquent eloquent illuminate-database orm
Last synced: 30 days ago
JSON representation
The Illuminate Database package for CodeIgniter 4
- Host: GitHub
- URL: https://github.com/agungsugiarto/codeigniter4-eloquent
- Owner: agungsugiarto
- License: mit
- Created: 2020-08-04T12:36:35.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-03-22T11:51:35.000Z (over 2 years ago)
- Last Synced: 2024-10-01T00:41:22.319Z (about 1 month ago)
- Topics: codeigniter4, codeigniter4-eloquent, eloquent, illuminate-database, orm
- Language: PHP
- Homepage:
- Size: 25.4 KB
- Stars: 25
- Watchers: 3
- Forks: 8
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# The Illuminate Database package for CodeIgniter 4
[![Latest Stable Version](https://poser.pugx.org/agungsugiarto/codeigniter4-eloquent/v)](https://packagist.org/packages/agungsugiarto/codeigniter4-eloquent)
[![Total Downloads](https://poser.pugx.org/agungsugiarto/codeigniter4-eloquent/downloads)](https://packagist.org/packages/agungsugiarto/codeigniter4-eloquent)
[![Latest Unstable Version](https://poser.pugx.org/agungsugiarto/codeigniter4-eloquent/v/unstable)](https://packagist.org/packages/agungsugiarto/codeigniter4-eloquent)
[![License](https://poser.pugx.org/agungsugiarto/codeigniter4-eloquent/license)](https://packagist.org/packages/agungsugiarto/codeigniter4-eloquent)## Update from v1.x to 2.x
just simple publish config eloquent with command
```php
php spark eloquent:publish
```## Instalation
Include this package via Composer:
```console
composer require agungsugiarto/codeigniter4-eloquent
```## Publish config
```php
php spark eloquent:publish
```## 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
Open App\Controllers\BaseController.phpadd `service('eloquent');` on function initController
```php
//--------------------------------------------------------------------
// Preload any models, libraries, etc, here.
//--------------------------------------------------------------------
// E.g.:
// $this->session = \Config\Services::session();service('eloquent');
```
## UsageExample model
```php
response->setJSON([
'data' => Authors::all(),
'sample' => DB::table('authors')->skip(1)->take(100)->get(),
]);
}
}```
## More info usefull link docs laravel
- [Database: Getting Started](https://laravel.com/docs/7.x/database)- [Eloquent: Getting Started](https://laravel.com/docs/7.x/eloquent)
## License
This package is free software distributed under the terms of the [MIT license](LICENSE.md).