PHP code example of oriondevelops / filament-backup

1. Go to this page and download the library: Download oriondevelops/filament-backup library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

oriondevelops / filament-backup example snippets




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());
    }
}



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')),
            );
    }
}



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),
            );
    }
}



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'),
            );
    }
}



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),
            );
    }
}