Welcome Guest, Not a member yet? Register   Sign In
Illuminate Database Wrapper

(This post was last modified: 5 hours ago by nfaiz.)


This is my fun project for last weekend. But I've got time constraint to release due to eid celebration.

Illuminate Database Wrapper for CodeIgniter 4.

It uses CodeIgniter 4 debug toolbar to show the query collector for Illuminate Database.

You can use Illuminate Database features like
  • Query Builder
  • Schema Builder
  • Eloquent ORM

I am not laravel developer, it just my colleague did ask me whether can use eloquent with CodeIgniter. So why not?

I cant explore much right now. Just reading a quick documentation here how to setup the library.

  1. Installation via composer
    composer require nfaiz/ci4-illuminate-database:dev-main

  2. Setup via spark
    php spark illuminatedb:publish

  3. Open app/Config/IlluminateDb.php for library configuration.

  4. Basic usage (query builder)

    Use capsule() for db instance. Make sure DBgroup connection has been made. You can set DBGroup at at app/Config/IlluminateDb.php.

    E.g for basic usage.

    In controller
    PHP Code:
    $user capsule()::table('users')->where('id'1)->get();
    $results capsule()::select('select * from users where id = ? or id = ?', [12]); 

    Debug toolbar
    [Image: 2MIxNp2.png]

Thank you.

Theme © iAndrew 2016 - Forum software by © MyBB