Search by

ciiixid / laravel-db-timetravel

nitefine

A local database time-travel snapshot CLI tool for Laravel developers

Package info

github.com/nitefine/laravel-db-timetravel

pkg:composer/ciiixid/laravel-db-timetravel

Statistics

Installs: 4

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-10-22 09:35 UTC

This package is auto-updated.

Last update: 2026-10-25 12:24:05 UTC


README

A lightweight Laravel package for database time-travel and Git-style workflows. Easily create snapshots, view timelines, and manage database branches and checkouts for MySQL and SQLite.

Requirements

  • PHP: ^8.2
  • Laravel: ^10.0 or ^11.0
  • Database: MySQL (requires mysqldump & mysql binaries) or SQLite

Installation

Install the package via Composer:

composer require nitefine/laravel-db-timetravel

Publish the configuration file (optional):

php artisan vendor:publish --tag=timetravel-config

Usage

1. Create a Snapshot

Save the current state of your database:

php artisan db:snap [snapshot-name]

2. View Timeline

List all available snapshots chronologically in a neat table:

php artisan db:timeline

3. Restore / Travel Back

Restore your database to a specific snapshot interactively:

php artisan db:travel

4. Git-Style Branching

Create a new database branch to test experimental features safely:

php artisan db:branch [branch-name] -m "Description of the branch"

5. Checkout Branch

Switch and restore your database to the latest snapshot of a specific branch:

php artisan db:checkout [branch-name]

Testing

Run tests locally during your development process:

vendor/bin/pest

License

The MIT License (MIT). Please see the LICENSE file for more information.