Download the PHP package surrealdb/laravel without Composer

On this page you can find all versions of the php package surrealdb/laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel

SurrealDB Laravel

Laravel integration for the official SurrealDB PHP SDK and the Surqlize ORM.

This package gives Laravel applications a publishable configuration file, service-container bindings, facades, an Artisan schema command, and testing helpers. Query execution and database protocol behavior are delegated to surrealdb/surrealdb.php; ORM models, query compilation, graph relations, and schema definitions are delegated to surqlize/surqlize.

Requirements

Requirement Version
PHP >=8.4
Laravel components ^11.0, ^12.0 or ^13.0
Surqlize surqlize/surqlize dev-main
SurrealDB PHP SDK surrealdb/surrealdb.php 2.0.0-alpha.0

Installation

Install the package with Composer:

While the SDK and ORM are still in active development, local workspace installs can use path repositories:

Publish the configuration:

Configuration

The package intentionally keeps SDK and ORM configuration separate:

config/surrealdb.php reads these common environment variables:

If SURREALDB_USERNAME is set, the package uses SDK RootAuth by default. For scoped authentication, set SURREALDB_AUTH_MODE to namespace, database, record, bearer, token, or none, then fill the matching keys in the published config.

The SDK config supports named connections:

config/surqlize.php contains the ORM model list and executor binding:

Service Container

Laravel auto-discovers two service providers:

The SDK provider binds:

The ORM provider binds:

The ORM provider also registers Surqlize's global ConnectionManager with a lazy executor that resolves the configured surqlize.executor binding only when a query executes. By default, that binding points at surrealdb.connection, so Surqlize model queries use the Laravel manager and connect lazily.

Models

Surqlize models are not Eloquent models. They extend Surqlize\Model\Model and use Surqlize attributes:

Register models that should participate in schema commands:

Schemas

Schemas implement Surqlize\Model\SchemaContract:

Preview schema statements:

Apply schema statements:

Queries

Use Surqlize's model APIs:

No manual executor is needed for normal Laravel usage. The package configures Surqlize to use the Laravel-managed SurrealDB executor:

Use the raw SDK when you need lower-level access:

Use the Laravel manager facade when you want lifecycle helpers around the same SDK client:

The Surqlize facade exposes schema and transaction helpers:

Surqlize::transaction() uses Surqlize's executor-based SurrealQL transaction batching. SDK-native transaction IDs are not exposed through the Laravel facade yet because they depend on WebSocket transport and server feature support.

Testing

Use the package testing trait to reset Surqlize's global caches:

For unit tests, pass a fake QueryExecutor to Surqlize queries or call useSurqlizeExecutor() from the trait.

You can also fake the Laravel-managed executor:

Named fakes are scoped by connection:

Development

Notes


All versions of laravel with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
illuminate/console Version ^11.0 || ^12.0 || ^13.0
illuminate/support Version ^11.0 || ^12.0 || ^13.0
surrealdb/surqlize Version 0.0.1-alpha.2
surrealdb/surrealdb.php Version 2.0.0-alpha.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package surrealdb/laravel contains the following files

Loading the files please wait ...