PHPackages                             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. [Database &amp; ORM](/categories/database)
4. /
5. illuminate/database

ActiveLibrary[Database &amp; ORM](/categories/database)

illuminate/database
===================

The Illuminate Database package.

v13.2.0(1mo ago)2.8k52.4M—1.5%612[7 PRs](https://github.com/illuminate/database/pulls)20MITPHPPHP ^8.3CI failing

Since Jul 5Pushed 2d ago110 watchersCompare

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

READMEChangelogDependencies (17)Versions (1003)Used By (20)Security (5)

Illuminate Database
-------------------

[](#illuminate-database)

The Illuminate Database component is a full database toolkit for PHP, providing an expressive query builder, ActiveRecord style ORM, and schema builder. It currently supports MySQL, Postgres, SQL Server, and SQLite. It also serves as the database layer of the Laravel PHP framework.

### Usage Instructions

[](#usage-instructions)

First, create a new "Capsule" manager instance. Capsule aims to make configuring the library for usage outside of the Laravel framework as easy as possible.

```
use Illuminate\Database\Capsule\Manager as Capsule;

$capsule = new Capsule;

$capsule->addConnection([
    'driver' => 'mysql',
    'host' => 'localhost',
    'database' => 'database',
    'username' => 'root',
    'password' => 'password',
    'charset' => 'utf8',
    'collation' => 'utf8_unicode_ci',
    'prefix' => '',
]);

// Set the event dispatcher used by Eloquent models... (optional)
use Illuminate\Events\Dispatcher;
use Illuminate\Container\Container;
$capsule->setEventDispatcher(new Dispatcher(new Container));

// Make this Capsule instance available globally via static methods... (optional)
$capsule->setAsGlobal();

// Setup the Eloquent ORM... (optional; unless you've used setEventDispatcher())
$capsule->bootEloquent();
```

> `composer require "illuminate/events"` required when you need to use observers with Eloquent.

Once the Capsule instance has been registered. You may use it like so:

**Using The Query Builder**

```
$users = Capsule::table('users')->where('votes', '>', 100)->get();
```

Other core methods may be accessed directly from the Capsule in the same manner as from the DB facade:

```
$results = Capsule::select('select * from users where id = ?', [1]);
```

**Using The Schema Builder**

```
Capsule::schema()->create('users', function ($table) {
    $table->increments('id');
    $table->string('email')->unique();
    $table->timestamps();
});
```

**Using The Eloquent ORM**

```
class User extends Illuminate\Database\Eloquent\Model {}

$users = User::where('votes', '>', 1)->get();
```

For further documentation on using the various database facilities this library provides, consult the [Laravel framework documentation](https://laravel.com/docs).

###  Health Score

87

—

ExcellentBetter than 100% of packages

Maintenance95

Actively maintained with recent releases

Popularity80

Widely adopted with strong download metrics

Community68

Healthy contributor diversity

Maturity98

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 58% 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 ~5 days

Total

1002

Last Release

53d ago

Major Versions

v11.45.0 → v12.4.02025-03-29

v11.46.0 → v12.28.12025-09-03

v11.46.2 → v12.32.02025-09-30

11.x-dev → v12.54.02026-03-09

12.x-dev → v13.0.02026-03-17

PHP version history (15 changes)v1.0.0PHP &gt;=5.3.0

v4.2.0-BETA1PHP &gt;=5.4.0

v5.1.1PHP &gt;=5.5.9

v5.3.0PHP &gt;=5.6.4

v5.5.0PHP &gt;=7.0

v5.6.0PHP ^7.1.3

v6.0.0PHP ^7.2

v7.0.2PHP ^7.2.5

v8.0.0PHP ^7.3

v6.20.0PHP ^7.2.5|^8.0

v8.12.0PHP ^7.3|^8.0

v9.0.0-beta.1PHP ^8.0.2

v10.0.0PHP ^8.1

v11.0.0PHP ^8.2

v13.0.0PHP ^8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/463230?v=4)[Taylor Otwell](/maintainers/taylorotwell)[@taylorotwell](https://github.com/taylorotwell)

---

Top Contributors

[![taylorotwell](https://avatars.githubusercontent.com/u/463230?v=4)](https://github.com/taylorotwell "taylorotwell (3127 commits)")[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (621 commits)")[![driesvints](https://avatars.githubusercontent.com/u/594614?v=4)](https://github.com/driesvints "driesvints (324 commits)")[![themsaid](https://avatars.githubusercontent.com/u/4332182?v=4)](https://github.com/themsaid "themsaid (157 commits)")[![staudenmeir](https://avatars.githubusercontent.com/u/1853169?v=4)](https://github.com/staudenmeir "staudenmeir (153 commits)")[![crynobone](https://avatars.githubusercontent.com/u/172966?v=4)](https://github.com/crynobone "crynobone (121 commits)")[![lucasmichot](https://avatars.githubusercontent.com/u/513603?v=4)](https://github.com/lucasmichot "lucasmichot (115 commits)")[![JosephSilber](https://avatars.githubusercontent.com/u/1403741?v=4)](https://github.com/JosephSilber "JosephSilber (91 commits)")[![hafezdivandari](https://avatars.githubusercontent.com/u/56585913?v=4)](https://github.com/hafezdivandari "hafezdivandari (56 commits)")[![browner12](https://avatars.githubusercontent.com/u/5232313?v=4)](https://github.com/browner12 "browner12 (52 commits)")[![acasar](https://avatars.githubusercontent.com/u/6329543?v=4)](https://github.com/acasar "acasar (45 commits)")[![iamgergo](https://avatars.githubusercontent.com/u/6567179?v=4)](https://github.com/iamgergo "iamgergo (43 commits)")[![nunomaduro](https://avatars.githubusercontent.com/u/5457236?v=4)](https://github.com/nunomaduro "nunomaduro (42 commits)")[![StyleCIBot](https://avatars.githubusercontent.com/u/11048387?v=4)](https://github.com/StyleCIBot "StyleCIBot (40 commits)")[![cosmastech](https://avatars.githubusercontent.com/u/42181698?v=4)](https://github.com/cosmastech "cosmastech (34 commits)")[![anlutro](https://avatars.githubusercontent.com/u/163093?v=4)](https://github.com/anlutro "anlutro (30 commits)")[![calebdw](https://avatars.githubusercontent.com/u/4176520?v=4)](https://github.com/calebdw "calebdw (29 commits)")[![antonkomarev](https://avatars.githubusercontent.com/u/1849174?v=4)](https://github.com/antonkomarev "antonkomarev (29 commits)")[![vlakoff](https://avatars.githubusercontent.com/u/544424?v=4)](https://github.com/vlakoff "vlakoff (28 commits)")[![mnabialek](https://avatars.githubusercontent.com/u/7656807?v=4)](https://github.com/mnabialek "mnabialek (25 commits)")

---

Tags

laraveldatabaseormsql

### Embed Badge

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

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

###  Alternatives

[laravel-doctrine/orm

An integration library for Laravel and Doctrine ORM

8425.3M87](/packages/laravel-doctrine-orm)[illuminate/validation

The Illuminate Validation package.

18936.7M1.4k](/packages/illuminate-validation)[illuminate/routing

The Illuminate Routing package.

1238.6M2.3k](/packages/illuminate-routing)[cybercog/laravel-clickhouse

ClickHouse migrations for Laravel

163166.8k](/packages/cybercog-laravel-clickhouse)[laravel-doctrine/acl

ACL for Laravel and Doctrine

44445.3k7](/packages/laravel-doctrine-acl)[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)
