PHP Classes

Codeigniter Eloquent ORM: Store CodeIgniter model objects using Eloquent ORM

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 40 All time: 10,919 This week: 64Up
Version License PHP version Categories
codeigniter-eloquent 1.0.0The PHP License5PHP 5, Libraries, Design Patterns
Description 

Author

This package can store and retrieve CodeIgniter model objects using Eloquent ORM.

It provides an example application that demonstrates how to use the Eloquent object-relational mapping package to store and retrieve in database tables the model class objects created using the CodeIgnieter framework.

PHP application developers can learn how to create CodeIgniter controller applications that call model classes that extend the Eloquent base model classes.

Innovation Award
PHP Programming Innovation award nominee
May 2022
Number 7
CodeIgniter is a popular PHP framework used by many developers to implement PHP applications following a consistent development method.

Eloquent ORM is a PHP package that can map model classes to database table records to store application data objects.

Often the Eloquent ORM is used in PHP applications that use the Laravel framework.

This package demonstrates that PHP developers can use to learn how to use the Eloquent ORM model class objects in a CodeIgniter application.

Manuel Lemos
Picture of aidid alam
Name: aidid alam <contact>
Classes: 2 packages by
Country: Bangladesh Bangladesh
Innovation award
Innovation award
Nominee: 2x

 

Documentation

Codeigniter 3.1.0 Integrated with Illuminate Database Eloquent

Requires

php: >=5.3.7

Installation

Install the Illuminate Database package with Composer:

$ composer install

Using The Eloquent ORM

Example:

Model

<?php
use \Illuminate\Database\Eloquent\Model as Eloquent;

class User extends Eloquent{
    protected $table = 'users';

}

Controller

defined('BASEPATH') OR exit('No direct script access allowed');

class Home extends CI_Controller {

	public function index()
	{
		$this->load->model('user');
		$users = User::where('votes', '>', 1)->get();
		$this->load->view('home/index', ['users' => $users]);
	}
}

Bonus

dd() Function is also implemented; Example:

class Home extends CI_Controller {

	public function index()
	{
		$this->load->model('user');
		$users = User::all();
        dd($users);
	}
}

Documentation

Inspired From


  Files folder image Files (256)  
File Role Description
Files folder imageapplication (2 files, 12 directories)
Files folder imagesystem (2 files, 7 directories)
Accessible without login Plain text file .editorconfig Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file index.php Aux. Auxiliary script
Accessible without login Plain text file readme.md Doc. Read me

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:40
This week:0
All time:10,919
This week:64Up