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.18.0(6d ago)2.8k54.9M↓27.3%609[7 PRs](https://github.com/illuminate/database/pulls)20MITPHPPHP ^8.3CI failing

Since Jul 5Pushed 2d ago109 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 yesterday

READMEChangelogDependencies (47)Versions (1031)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

88

—

ExcellentBetter than 100% of packages

Maintenance99

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

1030

Last Release

6d ago

Major Versions

v12.55.1 → v13.0.02026-03-17

v12.57.0 → v13.5.02026-04-14

v12.60.0 → v13.9.02026-05-10

v12.62.0 → v13.15.02026-06-08

12.x-dev → v13.17.02026-06-22

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.1PHP ^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

[illuminate/routing

The Illuminate Routing package.

1419.2M3.0k](/packages/illuminate-routing)[laravel/framework

The Laravel Framework.

34.8k543.8M20.0k](/packages/laravel-framework)[illuminate/validation

The Illuminate Validation package.

18838.2M1.7k](/packages/illuminate-validation)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M193](/packages/laravel-ai)[illuminate/queue

The Illuminate Queue package.

21332.6M1.6k](/packages/illuminate-queue)[illuminate/events

The Illuminate Events package.

13557.0M2.1k](/packages/illuminate-events)

PHPackages © 2026

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