Skip to content

axilivo/seedvault

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SeedVault

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors