This commit is contained in:
Bozhidar 2024-05-09 17:21:30 +03:00
parent 97ee0da261
commit a77bc147a4
2 changed files with 45 additions and 3 deletions

View file

@ -159,9 +159,10 @@ class BackupResource extends Resource
public static function getPages(): array public static function getPages(): array
{ {
return [ return [
'index' => Pages\ListBackups::route('/'), // 'index' => Pages\ListBackups::route('/'),
'create' => Pages\CreateBackup::route('/create'), // 'create' => Pages\CreateBackup::route('/create'),
'view' => Pages\ViewBackup::route('/{record}'), // 'view' => Pages\ViewBackup::route('/{record}'),
'index' => Pages\ManageBackups::route('/'),
]; ];
} }
} }

View file

@ -0,0 +1,41 @@
<?php
namespace App\Filament\Resources\BackupResource\Pages;
use App\Filament\Resources\BackupResource;
use Filament\Actions;
use Filament\Pages\Concerns\ExposesTableToWidgets;
use Filament\Resources\Components\Tab;
use Filament\Resources\Pages\ManageRecords;
class ManageBackups extends ManageRecords
{
use ExposesTableToWidgets;
protected static string $resource = BackupResource::class;
protected function getActions(): array
{
return [
Actions\CreateAction::make()
->size('sm')
->slideOver(),
];
}
protected function getHeaderWidgets(): array
{
return BackupResource::getWidgets();
}
public function getTabs(): array
{
return [
null => Tab::make('All'),
'completed' => Tab::make()->query(fn ($query) => $query->where('status', 'completed')),
'processing' => Tab::make()->query(fn ($query) => $query->where('status', 'processing')),
'failed' => Tab::make()->query(fn ($query) => $query->where('status', 'failed')),
];
}
}