This Filament plugin is a dedicated port of the spatie/nova-backup-tool, adapted to work seamlessly with Filament.
Much of the underlying codebase and functionality owe their origins to the work done by the contributors on the original Nova tool. This adaptation was undertaken with deep respect and acknowledgment of their effort.
The plugin lets you:
- List all backups
- Create a new backup
- Download a backup
- Delete a backup
Internally, it utilizes spatie/laravel-backup to manage these backups.
Ensure that you meet the requirements for spatie/laravel-backup.
Install spatie/laravel-backup into your Laravel app following its installation instructions.
You can install the package via composer:
composer require oriondevelops/filament-backup
Next you should setup a queue. Any driver is fine except the sync driver.
You need to register the plugin with your preferred Filament panel providers. This can be done inside of your PanelProvider
, e.g. AdminPanelProvider
.
<?php
namespace App\Providers\Filament;
use Filament\Panel;
use Filament\PanelProvider;
use Orion\FilamentBackup\BackupPlugin;
class AdminPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
// ...
->plugin(BackupPlugin::make());
}
}
You can now click on the "Backups" menu item in your Filament app to see the backup plugin.
Define who can view, download, or delete backups. Tailor access based on user permissions.
<?php
namespace App\Providers\Filament;
use Filament\Panel;
use Filament\PanelProvider;
use Orion\FilamentBackup\BackupPlugin;
class AdminPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
// ...
->plugin(
BackupPlugin::make()
->visible(fn() => auth()->user()->can('view backups'))
->downloadable(fn() => auth()->user()->can('download backups'))
->deletable(fn() => auth()->user()->can('delete backups')),
);
}
}
<?php
namespace App\Providers\Filament;
use Filament\Panel;
use Filament\PanelProvider;
use Orion\FilamentBackup\BackupPlugin;
class AdminPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
// ...
->plugin(
BackupPlugin::make()
->slug('my-precious-backups')
->label('Backups')
->icon('heroicon-o-server-stack')
->group('System')
->sort(3),
);
}
}
You can customise the polling interval or disable polling:
<?php
namespace App\Providers\Filament;
use Filament\Panel;
use Filament\PanelProvider;
use Orion\FilamentBackup\BackupPlugin;
class AdminPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
// ...
->plugin(
BackupPlugin::make()
->polling(enabled: true, interval: '10s'),
);
}
}
<?php
namespace App\Providers\Filament;
use Filament\Panel;
use Filament\PanelProvider;
use Orion\FilamentBackup\BackupPlugin;
use App\Filament\Pages\ExtendedBackupsPage;
class AdminPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
// ...
->plugin(
BackupPlugin::make()
->queue('custom-queue')
->page(ExtendedBackupsPage::class),
);
}
}
Please see CONTRIBUTING for details.
Please review Security Policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.