Create and manage where your database is located.
Returns a list of groups belonging to the organization or user.
$turso->groups()->list()->get();
Ref: https://docs.turso.tech/api-reference/groups/list
Creates a new group for the organization or user.
use Darkterminal\TursoPlatformAPI\core\Enums\Location;
use Darkterminal\TursoPlatformAPI\core\Enums\Extension;
// Create group with default closest region and all extension enables
$turso->groups()->create('punk')->get();
// Create group with selected region and all extension enables
$turso->groups()->create('punk', Location::AMS)->get();
// Create group with selected region and selected extensions enables
$turso->groups()->create('punk', Location::AMS, ->get()[
Extension::MATH,
Extension::TEXT
]);
Ref: https://docs.turso.tech/api-reference/groups/create
Returns a group belonging to the organization or user.
$turso->groups()->getGroup('punk')->get();
Ref: https://docs.turso.tech/api-reference/groups/retrieve
Delete a group belonging to the organization or user.
$turso->groups()->delete('punk')->get();
Ref: https://docs.turso.tech/api-reference/groups/delete
Adds a location to the specified group.
use Darkterminal\TursoPlatformAPI\core\Enums\Location;
$turso->groups()->addLocation('punk', Location::AMS)->get();
Ref: https://docs.turso.tech/api-reference/groups/add-location
Removes a location from the specified group.
use Darkterminal\TursoPlatformAPI\core\Enums\Location;
$turso->groups()->deleteLocation('punk', Location::AMS)->get();
Ref: https://docs.turso.tech/api-reference/groups/remove-location
Transfer a group to another organization that you own or a member of.
$turso->groups()->transfer('punk', 'universe')->get();
Ref: https://docs.turso.tech/api-reference/groups/transfer
Unarchive a group that has been archived due to inactivity.
$turso->groups()->unarchive('punk')->get();
Ref: https://docs.turso.tech/api-reference/groups/unarchive
Updates all databases in the group to the latest libSQL version.
$turso->groups()->updateVersion('punk')->get();
Ref: https://docs.turso.tech/api-reference/groups/update-database-versions
Generates an authorization token for the specified group.
use Darkterminal\TursoPlatformAPI\core\Enums\Authorization;
// Create group token that never expired with full-access permission
$turso->groups()->createToken('punk')->get();
// Create group token that will be expired in 2 week 1 day 30 minutes with full-access permission
$turso->groups()->createToken('punk', '2w1d30m')->get();
// Create group token that will be expired in 2 week 1 day 30 minutes with read-only permission
$turso->groups()->createToken('punk', '2w1d30m', Authorization::READ_ONLY)->get();
Ref: https://docs.turso.tech/api-reference/groups/create-token
Invalidates all authorization tokens for the specified group.
$turso->groups()->invalidateTokens('punk')->get();
Ref: https://docs.turso.tech/api-reference/groups/invalidate-tokens
Turso Groups: https://docs.turso.tech/api-reference/groups