Fix radio Filament: actions() must receive array not Closure

This commit is contained in:
root
2026-06-04 21:04:28 +02:00
parent be6a578f5e
commit 4f4f40ac99
2 changed files with 32 additions and 42 deletions
+12 -17
View File
@@ -6,7 +6,6 @@ namespace App\Filament\Pages\Radio;
use App\Models\RadioApiKey; use App\Models\RadioApiKey;
use Filament\Actions\Action; use Filament\Actions\Action;
use Filament\Actions\ActionGroup;
use Filament\Forms\Components\Select; use Filament\Forms\Components\Select;
use Filament\Forms\Components\TextInput; use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle; use Filament\Forms\Components\Toggle;
@@ -82,22 +81,18 @@ final class ApiKeys extends Page implements HasTable
->label('Aangemaakt') ->label('Aangemaakt')
->dateTime('d-m-Y H:i'), ->dateTime('d-m-Y H:i'),
]) ])
->actions(function ($record) { ->actions([
return [ Action::make('toggle')
ActionGroup::make([ ->label(fn ($record) => $record->is_active ? 'Deactiveren' : 'Activeren')
Action::make('toggle') ->icon(fn ($record) => $record->is_active ? 'heroicon-o-pause' : 'heroicon-o-play')
->label($record->is_active ? 'Deactiveren' : 'Activeren') ->action(fn ($record) => $this->toggleKey($record)),
->icon($record->is_active ? 'heroicon-o-pause' : 'heroicon-o-play') Action::make('delete')
->action(fn () => $this->toggleKey($record)), ->label('Verwijderen')
Action::make('delete') ->icon('heroicon-o-trash')
->label('Verwijderen') ->color('danger')
->icon('heroicon-o-trash') ->requiresConfirmation()
->color('danger') ->action(fn ($record) => $record->delete()),
->requiresConfirmation() ])
->action(fn () => $record->delete()),
]),
];
})
->headerActions([ ->headerActions([
Action::make('create') Action::make('create')
->label('Nieuwe API Sleutel') ->label('Nieuwe API Sleutel')
+20 -25
View File
@@ -6,7 +6,6 @@ namespace App\Filament\Pages\Radio;
use App\Models\RadioAutoDjTrack; use App\Models\RadioAutoDjTrack;
use Filament\Actions\Action; use Filament\Actions\Action;
use Filament\Actions\ActionGroup;
use Filament\Forms\Components\TextInput; use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle; use Filament\Forms\Components\Toggle;
use Filament\Notifications\Notification; use Filament\Notifications\Notification;
@@ -74,30 +73,26 @@ final class AutoDjPlaylist extends Page implements HasTable
->trueColor('success') ->trueColor('success')
->falseColor('danger'), ->falseColor('danger'),
]) ])
->actions(function ($record) { ->actions([
return [ Action::make('toggle_active')
ActionGroup::make([ ->label(fn ($record) => $record->is_active ? 'Deactiveren' : 'Activeren')
Action::make('toggle_active') ->icon(fn ($record) => $record->is_active ? 'heroicon-o-pause' : 'heroicon-o-play')
->label($record->is_active ? 'Deactiveren' : 'Activeren') ->action(fn ($record) => $this->toggleActive($record)),
->icon($record->is_active ? 'heroicon-o-pause' : 'heroicon-o-play') Action::make('move_up')
->action(fn () => $this->toggleActive($record)), ->label('Omhoog')
Action::make('move_up') ->icon('heroicon-o-chevron-up')
->label('Omhoog') ->action(fn ($record) => $this->moveUp($record)),
->icon('heroicon-o-chevron-up') Action::make('move_down')
->action(fn () => $this->moveUp($record)), ->label('Omlaag')
Action::make('move_down') ->icon('heroicon-o-chevron-down')
->label('Omlaag') ->action(fn ($record) => $this->moveDown($record)),
->icon('heroicon-o-chevron-down') Action::make('delete')
->action(fn () => $this->moveDown($record)), ->label('Verwijderen')
Action::make('delete') ->icon('heroicon-o-trash')
->label('Verwijderen') ->color('danger')
->icon('heroicon-o-trash') ->requiresConfirmation()
->color('danger') ->action(fn ($record) => $record->delete()),
->requiresConfirmation() ])
->action(fn () => $record->delete()),
]),
];
})
->headerActions([ ->headerActions([
Action::make('create') Action::make('create')
->label('Track Toevoegen') ->label('Track Toevoegen')