New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

atoms/database-illuminate

Illuminate bridge for Atoms: the Laravel query builder and Eloquent models against an Atom's own SQLite database.
22
Install
composer require atoms/database-illuminate
Latest Version:0.9.2
PHP:^8.3
Laravel:12 · 13
License:MIT
Last Updated:Nov 18, 2026
Links: GitHub  ·  Packagist
Maintainer: dabernathy89

atoms/database-illuminate

The Laravel query builder and Eloquent models against an Atom's own SQLite database. Supports Illuminate Database 12 and 13 on PHP 8.3 or later. This package runs inside the Atom — add it to atoms-composer.json (together with illuminate/database), not to your application's composer.json:

{
    "require": {
        "atoms/database-illuminate": "^0.9",
        "illuminate/database": "^13.0"
    }
}
use Atoms\Atom;
use Atoms\DatabaseIlluminate\EloquentBridge;

class GameRoom extends Atom
{
    public function record(string $player, int $score): array
    {
        $db = EloquentBridge::boot($this->db());

        $db->table('scores')->insert(['player' => $player, 'score' => $score]);

        return Score::query()->orderByDesc('score')->limit(10)->get()->toArray();
    }
}

Three deliberate differences from a stock Laravel connection, all inherited from the runtime the Atom executes in:

  • Nested transaction() calls reuse the outer transaction instead of creating savepoints — the same semantics as db()->transaction(). Roll an inner transaction back by throwing; a hand-called rollBack() inside a nested transaction() discards the entire write set and the enclosing wrappers then fail loudly on the already-closed transaction. afterCommit()/afterRollBack() hooks are unsupported (no transactions manager is installed; they throw).
  • Schema work is refused (ATOMS-E106): Atoms migrations own DDL.
  • getServerVersion() answers from configuration (the runtime cannot ask the engine), overridable via the server_version connection config key.

Eloquent models never cross the Atom boundary — return ->toArray() shapes from Atom methods. See the Atoms documentation for the full semantics notes, including the wide-integer (int64) limits of the Cloudflare runtime.

Development and support

This package is developed in the Atoms monorepo. Its standalone repository is a read-only distribution mirror; report issues and send pull requests to the monorepo. Licensed under the MIT License.

Related Packages

yadakhov/insert-on-duplicate-key

A trait for MySQL INSERT ON DUPLICATE KEY UPDATE.

3,137,066 275
audunru/eager-load-pivot-relations

Eager load pivot relations for Laravel Eloquent's BelongsToMany relation.

79,135 9
someonefamous/laravel-findby

Extended 'find' functionality for Eloquent (Laravel).

11,659 3
vluzrmos/eloquent-simple-searchable

An Eloquent Simple Searchable Scope.

213 2
hpolthof/laravel-eloquent-settings

Allow for dynamic blobbed settings in Eloquent models.

52 1

Version History

Version Released PHP Laravel License
0.9.2 ^8.3 ^12.0 || ^13.0 MIT
0.9.1 ^8.3 ^12.0 || ^13.0 MIT
0.9.0 ^8.3 ^12.0 || ^13.0 MIT
0.8.0 ^8.3 ^12.0 || ^13.0 MIT
0.7.0 ^8.3 ^12.0 || ^13.0 MIT