PHPackages                             boone-studios/laravel-surrealdb - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. boone-studios/laravel-surrealdb

ActiveLibrary[Database &amp; ORM](/categories/database)

boone-studios/laravel-surrealdb
===============================

Integrates SurrealDB with the Laravel framework

v0.3.0(1y ago)30170↓94.1%8[7 issues](https://github.com/boone-studios/laravel-surrealdb/issues)MITPHPPHP ^8.1

Since Jan 7Pushed 3mo ago3 watchersCompare

[ Source](https://github.com/boone-studios/laravel-surrealdb)[ Packagist](https://packagist.org/packages/boone-studios/laravel-surrealdb)[ Docs](https://github.com/boone-studios/laravel-surrealdb)[ RSS](/packages/boone-studios-laravel-surrealdb/feed)WikiDiscussions main Synced today

READMEChangelog (3)Dependencies (11)Versions (8)Used By (0)

   ![SurrealDB for Laravel](https://raw.githubusercontent.com/boone-studios/laravel-surrealdb/main/assets/logo-dark.svg)

 [![Latest Version on Packagist](https://camo.githubusercontent.com/d65ae270cef50d7868b013d1848329863a0dbb84d048003ee67dc15de4b03ee1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f626f6f6e652d73747564696f732f6c61726176656c2d7375727265616c64622e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/boone-studios/laravel-surrealdb) [![Total Downloads](https://camo.githubusercontent.com/9150834b86cc693c9e7c148364d327199eb502c2331d048d8218917c9c93c3c4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f626f6f6e652d73747564696f732f6c61726176656c2d7375727265616c6462)](https://packagist.org/packages/boone-studios/laravel-surrealdb) [![GitHub Actions](https://github.com/boone-studios/laravel-surrealdb/actions/workflows/main.yml/badge.svg)](https://github.com/boone-studios/laravel-surrealdb/actions/workflows/main.yml/badge.svg)

Overview
--------

[](#overview)

This package allows you to add a connection to SurrealDB in your Laravel project.

Installation
------------

[](#installation)

You can install the package via Composer:

```
composer require boone-studios/laravel-surrealdb
```

Usage
-----

[](#usage)

### Laravel

[](#laravel)

If you are using an older version of Laravel that doesn't support autoloading packages, add the service provider to `config/app.php`:

```
BooneStudios\Surreal\SurrealServiceProvider::class
```

### Lumen

[](#lumen)

Add the service provider to `bootstrap/app.php` in your project.

```
$app->register(BooneStudios\Surreal\SurrealServiceProvider::class);
```

Configuration
-------------

[](#configuration)

To configure a new SurrealDB connection, add a new connection entry to `config/database.php`:

```
'surrealdb' => [
    'driver' => 'surrealdb',
    'host' => env('DB_HOST', '127.0.0.1'),
    'port' => env('DB_PORT', 8000),
    'namespace' => env('DB_NAMESPACE', 'laravel'),
    'database' => env('DB_DATABASE', 'app'),
    'username' => env('DB_USERNAME', 'root'),
    'password' => env('DB_PASSWORD', 'root'),
],
```

Regarding the `namespace` parameter, from the [SurrealDB documentation](https://surrealdb.com/docs/surrealql/statements/define/namespace):

> SurrealDB has a multi-tenancy model which allows you to scope databases to a namespace. There is no limit to the number of databases that can be in a namespace, nor is there a limit to the number of namespaces allowed. Only users root users are authorized to create namespaces.
>
> Let's say that you're using SurrealDB to create a multi-tenant SaaS application. You can guarantee that the data of each tenant will be kept separate from other tenants if you put each tenant's databases into separate namespaces. In other words, this will ensure that information will remain siloed so user will only have access the information in the namespace they are a member of.

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Boone Studios, LLC](https://github.com/boone-studios)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Star History
------------

[](#star-history)

[![Star History Chart](https://camo.githubusercontent.com/f658ecae82c8703e1114a36aa1a5905df42f28561eaf15a519219ff1e22df092/68747470733a2f2f6170692e737461722d686973746f72792e636f6d2f7376673f7265706f733d626f6f6e652d73747564696f732f6c61726176656c2d7375727265616c646226747970653d44617465)](https://star-history.com/#boone-studios/laravel-surrealdb&Date)

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance57

Moderate activity, may be stable

Popularity26

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~345 days

Total

3

Last Release

585d ago

PHP version history (2 changes)v0.1.0PHP ^8.0.2

v0.2.1PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/76f1c4c8777cc7686e9ccd81c8f8deed5c4f443d7ca85cb4b78984acba7dd31c?d=identicon)[boonestudios](/maintainers/boonestudios)

---

Top Contributors

[![leemcd56](https://avatars.githubusercontent.com/u/1885663?v=4)](https://github.com/leemcd56 "leemcd56 (27 commits)")[![adaliszk](https://avatars.githubusercontent.com/u/5189131?v=4)](https://github.com/adaliszk "adaliszk (1 commits)")

---

Tags

eloquenthacktoberfesthacktoberfest2022hacktoberfest2023laravellaravel-packageormsurrealdblaraveldatabasemodeleloquentsurrealdb

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/boone-studios-laravel-surrealdb/health.svg)

```
[![Health](https://phpackages.com/badges/boone-studios-laravel-surrealdb/health.svg)](https://phpackages.com/packages/boone-studios-laravel-surrealdb)
```

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.4M96](/packages/mongodb-laravel-mongodb)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[illuminate/database

The Illuminate Database package.

2.8k54.9M11.7k](/packages/illuminate-database)[laravel/ai

The official AI SDK for Laravel.

1.0k3.2M203](/packages/laravel-ai)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45444.2k1](/packages/pressbooks-pressbooks)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
