# Laravel

The Laravel integration wires the SurrealDB PHP SDK and the Surqlize ORM into Laravel's config, service container, facades, and Artisan commands.

The [Laravel integration](https://github.com/surrealdb/surrealdb.laravel) connects SurrealDB to a Laravel application. It wires [version 2 of the SDK](/docs/reference/php/v2.md) and the [Surqlize ORM](/docs/reference/php/libraries/surqlize.md) 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.

> [!IMPORTANT]
> 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

- [Installation](/docs/reference/php/frameworks/laravel/installation.md) - Install the package and publish its configuration.

- [Configuration](/docs/reference/php/frameworks/laravel/configuration.md) - Set connection details, auth modes, and multiple connections.

## Using the integration

- [Container and facades](/docs/reference/php/frameworks/laravel/container-and-facades.md) - The service providers, container bindings, and the SurrealDB, Surreal, and Surqlize facades.

- [Queries and transactions](/docs/reference/php/frameworks/laravel/queries-and-transactions.md) - Run model queries, raw SurrealQL, and transactions in Laravel.

- [Schema commands](/docs/reference/php/frameworks/laravel/schema-commands.md) - Dump and apply your Surqlize schema with Artisan.

- [Testing](/docs/reference/php/frameworks/laravel/testing.md) - Fake the executor and assert the queries your code sends.

## Sources

- [GitHub repository](https://github.com/surrealdb/surrealdb.laravel)
- [Surqlize ORM](/docs/reference/php/libraries/surqlize.md) for models and queries
- [PHP SDK v2](/docs/reference/php/v2.md) for the underlying client
