Laravel Packages

Tyro Checkpoint: Instant SQLite Snapshots for Laravel Local Development

Published Updated

If you've ever run a migration that left your local SQLite database in a broken state, or a seeder that wiped out carefully arranged test data, and wished you could roll back to exactly where you started, Tyro Checkpoint is built for that workflow. Created by Hasin Hayder, this dev-only Laravel package lets you create named snapshots of your SQLite database and restore them instantly, without re-running migrations or seeders.

Tyro Checkpoint stores full copies of your SQLite database file outside the database itself. Metadata (names, timestamps, notes, lock status) is tracked in a checkpoints.json file, so restoring a snapshot won't wipe out your checkpoint history. Think of it like Git commits for your local database state.

Installation

composer require hasinhayder/tyro-checkpoint --dev
php artisan tyro-checkpoint:install

The install command verifies your database configuration and creates the storage/tyro-checkpoints/ directory where snapshots are stored.

Creating and Restoring Checkpoints

Creating a checkpoint is one command:

php artisan tyro-checkpoint:create [snapshot_name]

To see all your snapshots:

php artisan tyro-checkpoint:list

When you're ready to roll back:

php artisan tyro-checkpoint:restore [snapshot_name]

You can restore by name or by ID. Restored checkpoints remain available, so you can restore the same snapshot multiple times across a testing session without recreating it.

Managing Checkpoints

The package includes a handful of commands for keeping your checkpoints organized:

Command Description
tyro-checkpoint:add-note [id] Attach a note to a checkpoint
tyro-checkpoint:lock [id] Prevent a checkpoint from being deleted
tyro-checkpoint:unlock [id] Remove lock protection
tyro-checkpoint:delete [id] Delete a specific checkpoint
tyro-checkpoint:flush Delete all unlocked checkpoints at once

Locking is particularly useful for preserving a clean baseline—lock it, and tyro-checkpoint:flush won't touch it.

Optional Encryption

For development workflows involving production-like data, the package supports AES-256 file-level encryption. Generate a key first:

php artisan tyro-checkpoint:generate-key

Add the key to your .env file as TYRO_CHECKPOINT_ENCRYPTION_KEY, and new checkpoints will be encrypted automatically.

Note: if you lose or rotate the encryption key, any checkpoints created with the old key become inaccessible.

Configuration

To customize the storage path, publish the config file:

php artisan tyro-checkpoint:publish-config

This creates config/tyro-checkpoint.php, where you can change the snapshot directory and manage encryption settings.

A Few Things to Keep in Mind

Each checkpoint is a full copy of your database file, so disk usage grows with each snapshot. The flush command helps with cleanup, but locked checkpoints must be deleted manually. This also isn't a production backup tool—it's a local development convenience.

You can find the source code at hasinhayder/tyro-checkpoint on GitHub and read the full documentation on the project site.

Yannick Lyn Fatt photo

Staff Writer at Laravel News and Full stack web developer.

Sponsored

acquaintsoft logo
Acquaint Softtech

Hire Laravel developers with AI expertise at $20/hr. Get started in 48 hours.

Visit Acquaint Softtech

The latest

View all →
CPX: The Composer Package Executor for PHP image

CPX: The Composer Package Executor for PHP

Read article
Laravel AI SDK Adds Human-in-the-Loop Tool Approval image

Laravel AI SDK Adds Human-in-the-Loop Tool Approval

Read article
Pest 5 Released With Test Impact Analysis, Agent Verification, and Evals image

Pest 5 Released With Test Impact Analysis, Agent Verification, and Evals

Read article
Queue-SQL: Run Mass Deletes and Updates Across Parallel Queue Jobs image

Queue-SQL: Run Mass Deletes and Updates Across Parallel Queue Jobs

Read article
Blade Formatting in Laravel Pint image

Blade Formatting in Laravel Pint

Read article
Inertia DevTools Is Now on the Chrome Web Store image

Inertia DevTools Is Now on the Chrome Web Store

Read article