turso-platform-laravel maintained by darkterminal
Description
Laravel integration for the Turso Platform API PHP SDK
Author
Last update
2026/11/12 13:43
(dev-main)
License
Downloads
0
Turso Platform API for Laravel
Laravel integration for darkterminal/turso-api-client-php — exposes the Turso Platform API as a pre-configured shared client: publishable config, auto-discovered Service Provider, and a Facade so calls read naturally in Laravel apps.
Latest release: v1.1.0 (2026-11-12). PHP 8.3+ · Laravel 12+.
Requirements
| Component | Version |
|---|---|
| PHP | 8.3+ |
| Laravel | 12+ |
darkterminal/turso-api-client-php |
^2.1 (auto-installed) |
Installation
composer require darkterminal/turso-platform-laravel
The Service Provider and Facade are auto-discovered. No manual registration needed.
Configuration
TURSO_PLATFORM_API_TOKEN=your-platform-api-jwt
TURSO_PLATFORM_ORGANIZATION=your-org-slug # optional
TURSO_PLATFORM_ORGANIZATION_ID=your-org-uuid # required for v3 recovery operations
TURSO_PLATFORM_BASE_URL=https://api.turso.tech # optional override
Publish the config if you need to customize:
php artisan vendor:publish --provider="Darkterminal\TursoPlatformLaravel\TursoPlatformServiceProvider" --tag=turso-platform-config
Usage
Via Facade
use Darkterminal\TursoPlatformLaravel\TursoPlatform;
$databases = TursoPlatform::databases()->list();
$token = TursoPlatform::databases()->createToken('main', 'never', \Darkterminal\TursoPlatformAPI\Enums\Authorization::FULL_ACCESS);
Via container injection
use Darkterminal\TursoPlatformAPI\Client\Client;
public function index(Client $client)
{
$databases = $client->databases()->list();
// ...
}
Via manager
use Darkterminal\TursoPlatformLaravel\TursoPlatformManager;
$client = app(TursoPlatformManager::class)->client();
$databases = $client->databases()->list();
Uploading a SQLite dump
Uploads ship with the SDK (darkterminal/turso-api-client-php), not this package:
use Darkterminal\TursoPlatformAPI\Integrations\DatabaseUploader;
// Host and token come from a database created with seed.type='database_upload'.
$uploader = new DatabaseUploader($hostname, $databaseToken);
$body = $uploader->uploadDump('/path/to/dump.db'); // WAL, page_size=4096, auto_vacuum=0, UTF-8
Documentation
- Facade map — full resource inventory, env→builder mapping, contract quirks
- Architecture notes — container pipeline, bindings, lazy resolution, quality gates
- Troubleshooting —
TURSO_PLATFORM_API_TOKEN, publish tag, v3 recovery UUID, config cache - CHANGELOG
- Wiki — the same content rendered for GitHub browsing (Home, Facade Map, Architecture, Troubleshooting)
Security notes
TURSO_PLATFORM_API_TOKENis only attached as a Bearer header to requests bound for the configured base URL. It is never attached to upload or resolver hosts (those are separate integrations handled bydarkterminal/turso-api-client-php).- See
turso-api-client-phpfor the full set of retry/timeout/error behaviors and the contract-aligned exception hierarchy.
Contributors
See the contributor graph on GitHub.
Contributing & Security
Report issues or feature requests via GitHub Issues. Report vulnerabilities privately via GitHub Security Advisories.
License
MIT — see LICENSE.