php: >=5.3.7
Install the Illuminate Database package with Composer:
$ composer install
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]);
}
}
dd() Function is also implemented; Example:
class Home extends CI_Controller {
public function index()
{
$this->load->model('user');
$users = User::all();
dd($users);
}
}