Auto-discovered
Service provider and facade are registered through Laravel package discovery. Install, set env vars, and start calling TursoPlatform::....
Turso Platform API · Laravel integration
A thin, auto-discovered Laravel integration for the Turso Platform PHP SDK. Publish config, inject the client, or call the facade — and manage databases, groups, tokens, members, audit logs, and recovery from your Laravel app.
use Darkterminal\TursoPlatformLaravel\TursoPlatform;
Route::get('/databases', function () {
$dbs = TursoPlatform::databases()->list();
$token = TursoPlatform::databases()
->createToken('main');
return response()->json($dbs);
});
Why this package
This package keeps HTTP and contract logic in turso-api-client-php, while giving Laravel apps the familiar config, container, and facade ergonomics.
Service provider and facade are registered through Laravel package discovery. Install, set env vars, and start calling TursoPlatform::....
Token is read from TURSO_PLATFORM_API_TOKEN at resolution time. The package fails fast with clear configuration exceptions when required config is missing.
Use TursoPlatform facade, inject Client, or resolve TursoPlatformManager. All resolve the same shared SDK client.
Coverage
The facade maps 1:1 to the SDK client resources. Method signatures and contract behavior come from the underlying `turso-api-client-php` package.
Create, configure, token-mint, rotate, inspect usage/stats. databases().
Manage groups, locations, config, transfer, unarchive, tokens. groups().
Read/update org settings, plans, invoices, subscription, usage. organizations().
Manage users and invites with typed roles. members(), invites().
Personal and org-scoped Platform API token lifecycle. apiTokens().
Paginated organization audit logs for operational traceability. auditLogs().
List/restore deleted databases and groups via v3 UUID endpoints. recovery().
Validate tokens, inspect current user, list locations. auth(), user().
Install
Add the package, set Platform API credentials, and use the facade or container binding in your Laravel app.
Require darkterminal/turso-platform-laravel in a Laravel 12+ app.
Set TURSO_PLATFORM_API_TOKEN and optional org slug/UUID. Publish config if needed.
Call TursoPlatform::databases()->list() or inject Client. See the user manual.
$ composer require darkterminal/turso-platform-laravel
# .env
$ TURSO_PLATFORM_API_TOKEN=...
$ TURSO_PLATFORM_ORGANIZATION=acme
# optional
$ php artisan vendor:publish --tag=turso-platform-config
The user manual covers configuration, facade/container usage, every resource area, SDK integrations, error handling, troubleshooting, and architecture notes.