The Laravel integration connects SurrealDB to a Laravel application. It wires version 2 of the SDK and the Surqlize ORM into Laravel's config, service container, facades, and Artisan commands.
Query execution and the database protocol are delegated to the SDK. Models, query compilation, graph relations, and schema definitions are delegated to Surqlize. The integration adds the Laravel glue: publishable config, container bindings, facades, schema commands, and testing helpers.
The integration is published as 0.0.1-alpha.1 and is in early development. It requires PHP 8.4 and Laravel 11, 12, or 13, and depends on the alpha SDK and ORM.
It does not replace Laravel's SQL database. SurrealDB runs alongside your existing connections, and the integration does not use Eloquent or config/database.php.
Getting started
Using the integration
Container and facades
The service providers, container bindings, and the SurrealDB, Surreal, and Surqlize facades.
Queries and transactions
Run model queries, raw SurrealQL, and transactions in Laravel.
Schema commands
Dump and apply your Surqlize schema with Artisan.
Testing
Fake the executor and assert the queries your code sends.
Sources
Surqlize ORM for models and queries
PHP SDK v2 for the underlying client