PHPackages                             electro-modules/illuminate-database - 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. electro-modules/illuminate-database

ActiveElectro-plugin

electro-modules/illuminate-database
===================================

Integrates the Laravel's Illuminate Database Component into the Electro framework

0.10.15(5y ago)02.2k26MITPHPPHP &gt;=5.6

Since Nov 8Pushed 1y ago4 watchersCompare

[ Source](https://github.com/electro-modules/illuminate-database)[ Packagist](https://packagist.org/packages/electro-modules/illuminate-database)[ Docs](https://github.com/electro-modules/illuminate-database)[ RSS](/packages/electro-modules-illuminate-database/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (6)Versions (23)Used By (6)

Illuminate Database Plugin
==========================

[](#illuminate-database-plugin)

Integrates the Laravel's Illuminate Database Component into the Electro framework

### Introdution

[](#introdution)

This plugin integrates with `PhpKit\ExtPDO` and the framework's database subsystem, so that connections defined on the framework's `Connections` service are automatically available as Illuminate Database connections.

Installation
------------

[](#installation)

#### Server Requirements

[](#server-requirements)

- PHP &gt;= 5.6
- A fully-functional installation of the Electro framework
- [Laravel's requirements](https://laravel.com/docs/5.2#server-requirements)

#### Installation

[](#installation-1)

To install this plugin on your application, using the terminal, `cd` to your app's directory and type:

```
workman install plugin electro-modules/illuminate-database
```

> For correct operation, do not install this package directly with Composer.

Using the plugin
----------------

[](#using-the-plugin)

First, start by injecting the plugin API into your controller (or component, command, migration, etc).

```
use Electro\Plugins\IlluminateDatabase\DatabaseAPI;

class MyController
{
  private $api;

  function __construct (DatabaseAPI $api) {
    $this->api = $api;
  }
}
```

### Using the query builder

[](#using-the-query-builder)

##### Example

[](#example)

```
$this->api->query()->from('products')->where('type','box')->get();
```

or simply

```
$this->api->table('products')->where('type','box')->get();
```

### Using the schema builder

[](#using-the-schema-builder)

##### Example

[](#example-1)

```
use Illuminate\Database\Schema\Blueprint;

$this->api->schema()->create ('news', function (Blueprint $table) {
    $table->increments ('id');
    $table->string ('title', 100);
});
```

### Facades

[](#facades)

This plugin also emulates some common database-related Laravel facades:

- `DB::method()` - equivalent to `$api->connection ()->method()`
- `Schema::method()` - equivalent to `$api->schema()->method()`

This way, you don't need to inject an API instance to call the query builder or the schema builder.

> **Note:** being an anti-pattern, facades are not recommended for development with Electro.

Be sure to import the related namespaces before using the facades (do **not** use the original facades, it won't work).

- `use Electro\Plugins\IlluminateDatabase\DB;`
- `use Electro\Plugins\IlluminateDatabase\Schema;`

### Using Eloquent

[](#using-eloquent)

To use Eloquent, access your models as usual, but don't forget to base their classes on ` Electro\Plugins\IlluminateDatabase\BaseModel` instead of `Illuminate\Database\Eloquent\Model`.

##### Example

[](#example-2)

```
use Electro\Plugins\IlluminateDatabase\BaseModel;

class Article extends BaseModel { }

$article = Article::find(1);

```

### Migrations

[](#migrations)

#### Available commands

[](#available-commands)

CommandDescription`make:migration`Create a new database migration.`make:seeder`Create a new database seeder.`migrate`Runs all pending migrations of a module, optionally up to a specific version.`migrate:refresh`Reset and re-run all migrations.`migrate:reset`Rollback all database migrations.`migration:rollback`Reverts the last migration of a specific module, or optionally up to a specific version.`migration:seed`Run all available seeders of a specific module, or just a specific seeder.`migration:status`Print a list of all migrations of a specific module, along with their current status.You can also type `workman` on the terminal to get a list of available commands.

Type `worman help xxx` (where `xxx` is the command name) to know which arguments and options each command supports.

License
-------

[](#license)

The Electro framework is open-source software licensed under the [MIT license](http://opensource.org/licenses/MIT).

**Electro framework** - Copyright © Cláudio Silva and Impactwave, Lda.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~81 days

Recently: every ~12 days

Total

20

Last Release

1904d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/750f00fdbb8cb2fd1c11c5c26b512217451bb001ac48a77542efa7123b9e2124?d=identicon)[impactwave](/maintainers/impactwave)

---

Top Contributors

[![claudio-silva](https://avatars.githubusercontent.com/u/1999803?v=4)](https://github.com/claudio-silva "claudio-silva (90 commits)")[![tiagomgelias](https://avatars.githubusercontent.com/u/38112456?v=4)](https://github.com/tiagomgelias "tiagomgelias (9 commits)")[![goncalomartins](https://avatars.githubusercontent.com/u/19184021?v=4)](https://github.com/goncalomartins "goncalomartins (1 commits)")[![mauromangas](https://avatars.githubusercontent.com/u/12101506?v=4)](https://github.com/mauromangas "mauromangas (1 commits)")[![paulocesarelias](https://avatars.githubusercontent.com/u/1014076?v=4)](https://github.com/paulocesarelias "paulocesarelias (1 commits)")

---

Tags

pluginelectro

### Embed Badge

![Health badge](/badges/electro-modules-illuminate-database/health.svg)

```
[![Health](https://phpackages.com/badges/electro-modules-illuminate-database/health.svg)](https://phpackages.com/packages/electro-modules-illuminate-database)
```

###  Alternatives

[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

44643.1k1](/packages/pressbooks-pressbooks)[defstudio/pest-plugin-laravel-expectations

A plugin to add laravel tailored expectations to Pest

98548.9k4](/packages/defstudio-pest-plugin-laravel-expectations)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
