Open source · MIT · Laravel 12 & 13

libSQL for Laravel,
without leaving Laravel.

A database driver backed by the native libSQL PHP extension. Use Eloquent, the Query Builder, migrations, and transactions against local libSQL, Turso Cloud, or an embedded replica.

use Illuminate\Support\Facades\DB;

DB::table('users')->insert([
    'name' => 'Budi Dalton',
    'email' => 'budi.dalton@duck.com',
]);

$users = DB::table('users')
    ->where('active', 1)
    ->orderBy('id', 'DESC')
    ->get();

Laravel's database API, on libSQL

The driver plugs into Laravel's database layer. Your models, migrations, and query code stay familiar; the connection below changes.

Native libSQL PHP extension

This package installs the libsql_php extension through its bundled Artisan installer. It is a Laravel driver, not a pure-PHP HTTP client — the extension is part of the stack.

Standard APIs

Eloquent, Query Builder, schema builder, migrations, and transactions are exercised by the test suite and the proof harness.

Four connection modes

In-memory, local file, remote Turso Cloud, and remote replica with DB::sync() for explicit synchronization.

Offline writes, two flavors

Journal writes for Turso Cloud, or replay a local journal to self-hosted sqld. Both are opt-in and documented with their ordering requirements and beta status.

Install in two commands

Composer for the package, Artisan for the native extension.

shell
 composer require tursodatabase/turso-driver-laravel
php artisan turso-php:install

Before you run it

  • PHP 8.2–8.5, Laravel 12 or 13 (13 needs PHP 8.3+)
  • A libsql connection in config/database.php
  • No manual php.ini edit — use the Artisan installer

After install

  • Register the service provider in bootstrap/providers.php
  • Set DB_CONNECTION=libsql and your connection variables
  • Read the user manual for modes and limits
— Stars
— Contributors
v1.7.0 Latest release

Documented in the open

The manual in this repository is the source of truth. It is built from verified tests, CI runs, and the Docker proof harness — not from marketing copy.

View on GitHub

Need the full picture?

The user manual covers configuration, connection modes, offline writes, Artisan commands, verification, and known limitations.