axilivo / seedvault
A Laravel package to create, manage, and restore database snapshots as Seeder files with a simple UI and Artisan commands.
README
SeedVault is a simple Laravel package to create, manage, and restore database snapshots as Seeder files β right from the UI or Artisan commands.
π¦ Features
β
Take a snapshot of your database (except migrations & snapshot table).
β
Store snapshots in database/seeders/
with a unique timestamp.
β
View snapshot history with date/time.
β
Restore database from any snapshot.
β
Delete snapshots you donβt need.
β
Clean TailwindCSS-powered standalone UI.
π Installation
composer require axilivo/seedvault
βοΈ Publish & Migrate
The package auto-loads its migration. Just run:
php artisan migrate
This creates the axilivo_seed_snapshots
table to keep track of your snapshots.
π§© Usage
β 1. Create a snapshot
-
Using Artisan:
php artisan seedvault:snapshot
-
Or using the UI:
Visit
/seed-vault
in your browser and click Create Snapshot.
β 2. Restore a snapshot
-
From the UI: Click Restore next to the snapshot you want.
-
Or run manually:
php artisan db:seed --class=Database\\Seeders\\AllTableDataSeeder_YYYY_MM_DD_HHMMSS
(Replace with your snapshotβs class name.)
β 3. Delete a snapshot
- From the UI, click Delete.
- This will remove both the Seeder file & the DB record.
π Routes
Method | URI | Action |
---|---|---|
GET | /seed-vault |
View all snapshots |
POST | /seed-vault/create |
Create snapshot |
POST | /seed-vault/restore/{id} |
Restore snapshot |
DELETE | /seed-vault/delete/{id} |
Delete snapshot |
All routes are auto-loaded with the web
middleware and seed-vault
prefix.
ποΈ File Locations
- Snapshots:
database/seeders/
- Log table:
axilivo_seed_snapshots
β‘ Quick Example: Seeder file
A generated Seeder file looks like:
<?php namespace Database\Seeders; use Illuminate\Database\Seeder; use Illuminate\Support\Facades\DB; class AllTableDataSeeder_2025_07_11_153000 extends Seeder { public function run(): void { DB::table('your_table')->truncate(); DB::table('your_table')->insert([ // Your data snapshot ]); } }
π€ Contributing
PRs and issues are welcome! This package is MIT licensed.
π’ Credits
Built with β€οΈ by Axilivo.
π License
The MIT License (MIT). Please see License File for more information.