quillphp/eloquent

Tested, worker-safe Eloquent ORM integration for the Quill PHP framework

Maintainers

Package info

github.com/quillphp/quill-eloquent

Homepage

pkg:composer/quillphp/eloquent

Statistics

Installs: 11

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

0.0.1 2026-04-06 14:05 UTC

This package is auto-updated.

Last update: 2026-04-06 15:51:48 UTC


README

Tested, worker-safe Eloquent ORM integration for the Quill PHP framework.

Features

  • Service Provider Integration: Auto-registers DB and Capsule in the Quill container.
  • 🔄 Auto-reconnection: Detects "Gone away" errors and automatically reconnects in long-running processes.
  • Database Middleware: Per-request health checks to ensure your worker is always ready to serve.

Installation

composer require quillphp/eloquent

Setup

Register the EloquentServiceProvider in your public/index.php:

use Quill\Eloquent\EloquentServiceProvider;

$app = new App();
$app->setContainer(new \Quill\Container\Container());

EloquentServiceProvider::register($app, [
    'driver'    => 'mysql',
    'host'      => '127.0.0.1',
    'database'  => 'quill',
    'username'  => 'root',
    'password'  => '',
    'charset'   => 'utf8mb4',
    'collation' => 'utf8mb4_unicode_ci',
    'prefix'    => '',
]);

Worker Safety

For long-running CLI workers, it is highly recommended to use the DatabaseMiddleware to ensure the connection is healthy before each request:

use Quill\Eloquent\Middleware\EnsureDatabaseConnection;

$app->use(EnsureDatabaseConnection::class);

License

MIT