axilivo/seedvault

A Laravel package to create, manage, and restore database snapshots as Seeder files with a simple UI and Artisan commands.

v1.0.0 2025-07-11 14:09 UTC

This package is auto-updated.

Last update: 2025-07-11 14:16:17 UTC


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.