定制 boone-studios/laravel-surrealdb 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

boone-studios/laravel-surrealdb

最新稳定版本:v0.3.0

Composer 安装命令:

composer require boone-studios/laravel-surrealdb

包简介

Integrates SurrealDB with the Laravel framework

README 文档

README


SurrealDB for Laravel


Latest Version on Packagist Total Downloads GitHub Actions

Overview

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

Installation

You can install the package via Composer:

composer require boone-studios/laravel-surrealdb

Usage

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

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

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

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:

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

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

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

Credits

License

The MIT License (MIT). Please see License File for more information.

Star History

Star History Chart

统计信息

  • 总下载量: 119
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 28
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 28
  • Watchers: 3
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-05-09