feat(failed-jobs): add database-agnostic failed jobs with bulk actions
- Create custom implementation to replace vendor plugin - Add database-agnostic JSON queries (MySQL, MariaDB, PG, SQLite, SQLSRV) - Implement Retry/Prune header actions with queue selection - Maintain all original features: filters, search, actions, bulk operations BREAKING CHANGE: New route /failed-jobs/compatible-failed-jobs Fixes MariaDB JSON syntax errors
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Resources\FailedJobs;
|
||||
|
||||
use App\Filament\Resources\FailedJobs\Pages\CompatibleListFailedJobs;
|
||||
use BackedEnum;
|
||||
use BinaryBuilds\FilamentFailedJobs\Models\FailedJob;
|
||||
use BinaryBuilds\FilamentFailedJobs\Resources\FailedJobs\Pages\ViewFailedJob;
|
||||
use BinaryBuilds\FilamentFailedJobs\Resources\FailedJobs\Schemas\FailedJobInfolist;
|
||||
use Filament\Resources\Resource;
|
||||
use Filament\Schemas\Schema;
|
||||
use Filament\Support\Icons\Heroicon;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class CompatibleFailedJobResource extends Resource
|
||||
{
|
||||
protected static ?string $model = FailedJob::class;
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = Heroicon::QueueList;
|
||||
|
||||
protected static string|null|\UnitEnum $navigationGroup = 'Admin';
|
||||
|
||||
public static function infolist(Schema $schema): Schema
|
||||
{
|
||||
return FailedJobInfolist::configure($schema);
|
||||
}
|
||||
|
||||
public static function table(Table $table): Table
|
||||
{
|
||||
return CompatibleFailedJobsTable::configure($table)
|
||||
->defaultSort('id', 'desc');
|
||||
}
|
||||
|
||||
public static function getPages(): array
|
||||
{
|
||||
return [
|
||||
'index' => CompatibleListFailedJobs::route('/'),
|
||||
'view' => ViewFailedJob::route('/{record}'),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Only make this resource available in specific panels
|
||||
*/
|
||||
public static function canViewAny(): bool
|
||||
{
|
||||
// Check if we're in the 0xdash panel or other admin panels
|
||||
$panel = filament()->getCurrentPanel();
|
||||
|
||||
return in_array($panel->getId(), ['0xdash', 'admin']);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user