• Start

v1 (stable)

/

Methods

signup

The ->signup() method for the SurrealDB SDK for PHP signs up to a specific access method.

Signs up to a specific authentication access method.

Method Syntax
$db->signup([
    "namespace" => "main",
    "database" => "db",
    "access" => "account",
    // ... other variables
]);

Arguments

Description

namespace

The namespace to sign up to

database

The database to sign up to

access

The access method to sign up to. Also pass any variables used in the access definition.

$token = $db->signup([
	"namespace" => "surrealdb",
	"database" => "docs",
	"access" => "user",

	// Also pass any properties required by the access definition
	"email" => "info@surrealdb.com",
	"pass" => "123456",
]);

You can invalidate the authentication for the current connection using the invalidate() method.

Was this page helpful?