Install

composer require darkterminal/turso-platform-laravel

The service provider and facade are auto-discovered by Laravel. No manual registration is required.

Configure environment

Set the Platform API token:

TURSO_PLATFORM_API_TOKEN=your-platform-api-token
TURSO_PLATFORM_ORGANIZATION=your-org-slug

Optional values:

TURSO_PLATFORM_ORGANIZATION_ID=your-org-uuid
TURSO_PLATFORM_BASE_URL=https://api.turso.tech
TURSO_PLATFORM_TIMEOUT=20

TURSO_PLATFORM_ORGANIZATION_ID is only required for v3 recovery operations. It must be the organization UUID, not the slug.

Publish config (optional)

php artisan vendor:publish --provider="Darkterminal\TursoPlatformLaravel\TursoPlatformServiceProvider" --tag=turso-platform-config

This creates config/turso-platform.php. The token is intentionally not stored in config; it is read from TURSO_PLATFORM_API_TOKEN.

First call with the facade

use Darkterminal\TursoPlatformLaravel\TursoPlatform;

Route::get('/turso/databases', function () {
    return TursoPlatform::databases()->list();
});

First call with dependency injection

use Darkterminal\TursoPlatformAPI\Client\Client;

Route::get('/turso/user', function (Client $client) {
    return $client->user()->get();
});

Validate the token

$validation = TursoPlatform::auth()->validate();

Next steps