axilivo/seedvault
最新稳定版本:v1.0.0
Composer 安装命令:
composer require axilivo/seedvault
包简介
A Laravel package to create, manage, and restore database snapshots as Seeder files with a simple UI and Artisan commands.
README 文档
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-vaultin 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.
统计信息
- 总下载量: 501
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-07-11