• Start

Languages

/

PHP

/

Frameworks

/

Laravel

Installation

Install the SurrealDB Laravel integration with Composer and publish the SDK and ORM configuration files.

Install the integration with Composer. It requires PHP 8.4 or later and Laravel 11, 12, or 13, and pulls in the alpha SDK and Surqlize ORM.

composer require surrealdb/laravel

The integration depends on alpha releases, so your project must allow them. If Composer cannot resolve the dependencies under the default stable minimum stability, lower it.

composer config minimum-stability alpha
composer config prefer-stable true

The SDK and ORM keep their configuration separate. Publish both files.

php artisan vendor:publish --tag=surrealdb-config
php artisan vendor:publish --tag=surqlize-config

This creates config/surrealdb.php for the SDK client and config/surqlize.php for the ORM.

Laravel auto-discovers the two service providers, so there is nothing to register manually. See Container and facades for what they bind.

Was this page helpful?