spiggle / filament-portal-snapshot
Filament 4/5 plugin for creating, scheduling, restoring, exporting and remotely storing database snapshots with automated demo resets.
Package info
github.com/skillbobby/Spiggle-Filament-Portal-Snapshot
pkg:composer/spiggle/filament-portal-snapshot
Fund package maintenance!
Requires
- php: ^8.3
- filament/filament: ^4.0|^5.0
- illuminate/console: ^11.0|^12.0|^13.0
- illuminate/contracts: ^11.0|^12.0|^13.0
- illuminate/database: ^11.0|^12.0|^13.0
- illuminate/mail: ^11.0|^12.0|^13.0
- illuminate/notifications: ^11.0|^12.0|^13.0
- illuminate/support: ^11.0|^12.0|^13.0
- spatie/laravel-db-snapshots: ^2.6
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- laravel/pint: ^1.18
- orchestra/testbench: ^9.0|^10.0|^11.0
- pestphp/pest: ^3.0|^4.0
- pestphp/pest-plugin-laravel: ^3.0|^4.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Spiggle Filament Portal Snapshot
A Filament 4.x and 5.x panel plugin for creating, scheduling, restoring, exporting, and remotely storing database snapshots with automated demo resets. It gives operators a calm, powerful dashboard to:
- take a snapshot now
- restore / revert a snapshot
- export (download) a dump
- copy a dump to remote storage (S3, GCS, SFTP, Google Drive via a Flysystem disk)
- schedule recurring snapshots
- schedule a midnight demo reset against a golden baseline
- clean up old dumps
- get a Filament bell notification and a queued email when work finishes
Requirements
| Package | Version |
|---|---|
| PHP | ^8.3 |
| Laravel | 11, 12 or 13 |
| Filament | ^4.0 or ^5.0 |
Installation
composer require spiggle/filament-portal-snapshot php artisan filament-portal-snapshot:install
Add a snapshots disk to config/filesystems.php:
'snapshots' => [ 'driver' => 'local', 'root' => database_path('snapshots'), ],
Register the plugin:
use Spiggle\FilamentPortalSnapshot\FilamentPortalSnapshotPlugin; $panel->plugin( FilamentPortalSnapshotPlugin::make() ->authorize(fn (): bool => auth()->user()?->is_admin ?? false) ->navigationGroup('Portal') ->navigationSort(80) );
Ensure Laravel's scheduler is running. The plugin registers portal-snapshot:run-schedules every minute.
Demo reset
- Create a snapshot while the portal looks correct.
- Mark it golden on Portal → Snapshots.
- Add a schedule: Restore snapshot / Every night at 00:00 / Restore the golden snapshot.
Configuration
Open Snapshot settings in the panel to choose the storage disk and local directory, remote copies, notifications, restore environments and the queue. Saved settings are stored in portal_snapshot_settings and override the config file on the next request.
You can still set defaults in config/filament-portal-snapshot.php and the environment. Use Reset to config defaults on the settings page to drop the saved values.
PORTAL_SNAPSHOT_DISK=snapshots PORTAL_SNAPSHOT_PATH= PORTAL_SNAPSHOT_COMPRESS=true PORTAL_SNAPSHOT_KEEP=14 PORTAL_SNAPSHOT_QUEUE=default PORTAL_SNAPSHOT_REMOTE_ENABLED=true PORTAL_SNAPSHOT_REMOTE_DISKS=s3,backups PORTAL_SNAPSHOT_MAIL=true PORTAL_SNAPSHOT_MAIL_RECIPIENTS=ops@example.com
License
MIT © Spiggle - @iamspiggle
