PHP code example of nehalfstudio / filament-backup

1. Go to this page and download the library: Download nehalfstudio/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/ */

    

nehalfstudio / filament-backup example snippets


use NehalfStudio\FilamentBackup\Filament\FilamentBackupPlugin;

return $panel
    // ...
    ->plugin(FilamentBackupPlugin::make());

   ->viteTheme('resources/css/filament/admin/theme.css')
   

use NehalfStudio\FilamentBackup\Filament\FilamentBackupPlugin;

->plugin(
    FilamentBackupPlugin::make()
        ->authorize(fn (): bool => auth()->user()?->email === '[email protected]')
        ->usingPollingInterval('30s') // optional Livewire poll to refresh the page
        // ->usingPage(App\Filament\Pages\CustomBackups::class) // must extend ManageBackups
)

FilamentBackupPlugin::make()->authorize(fn (): bool => auth()->user()?->is_admin);

Gate::define('interactWithFilamentBackup', fn (User $user) => $user->is_admin);
bash
php artisan vendor:publish --tag=filament-backup-config
bash
php artisan filament:assets
bash
   php artisan vendor:publish --tag=filament-backup-panel-theme
   
bash
php artisan notifications:table
php artisan migrate
bash
php artisan config:clear
bash
php artisan vendor:publish --tag=filament-backup-translations
bash
php artisan config:clear
php artisan filament-backup:google-auth --credentials=/absolute/path/to/client_secret….json
bash
php artisan config:clear
php artisan filament-backup:run storage
bash
php artisan queue:work --timeout=7200
bash
php artisan filament-backup:run           # default: both
php artisan filament-backup:run database
php artisan filament-backup:run storage
php artisan filament-backup:run both

php artisan filament-backup:google-auth   # recommended: OAuth refresh token for personal Drive quota