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
+6 -11
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 [
ActionGroup::make([
Action::make('toggle') Action::make('toggle')
->label($record->is_active ? 'Deactiveren' : 'Activeren') ->label(fn ($record) => $record->is_active ? 'Deactiveren' : 'Activeren')
->icon($record->is_active ? 'heroicon-o-pause' : 'heroicon-o-play') ->icon(fn ($record) => $record->is_active ? 'heroicon-o-pause' : 'heroicon-o-play')
->action(fn () => $this->toggleKey($record)), ->action(fn ($record) => $this->toggleKey($record)),
Action::make('delete') Action::make('delete')
->label('Verwijderen') ->label('Verwijderen')
->icon('heroicon-o-trash') ->icon('heroicon-o-trash')
->color('danger') ->color('danger')
->requiresConfirmation() ->requiresConfirmation()
->action(fn () => $record->delete()), ->action(fn ($record) => $record->delete()),
]), ])
];
})
->headerActions([ ->headerActions([
Action::make('create') Action::make('create')
->label('Nieuwe API Sleutel') ->label('Nieuwe API Sleutel')
+8 -13
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 [
ActionGroup::make([
Action::make('toggle_active') Action::make('toggle_active')
->label($record->is_active ? 'Deactiveren' : 'Activeren') ->label(fn ($record) => $record->is_active ? 'Deactiveren' : 'Activeren')
->icon($record->is_active ? 'heroicon-o-pause' : 'heroicon-o-play') ->icon(fn ($record) => $record->is_active ? 'heroicon-o-pause' : 'heroicon-o-play')
->action(fn () => $this->toggleActive($record)), ->action(fn ($record) => $this->toggleActive($record)),
Action::make('move_up') Action::make('move_up')
->label('Omhoog') ->label('Omhoog')
->icon('heroicon-o-chevron-up') ->icon('heroicon-o-chevron-up')
->action(fn () => $this->moveUp($record)), ->action(fn ($record) => $this->moveUp($record)),
Action::make('move_down') Action::make('move_down')
->label('Omlaag') ->label('Omlaag')
->icon('heroicon-o-chevron-down') ->icon('heroicon-o-chevron-down')
->action(fn () => $this->moveDown($record)), ->action(fn ($record) => $this->moveDown($record)),
Action::make('delete') Action::make('delete')
->label('Verwijderen') ->label('Verwijderen')
->icon('heroicon-o-trash') ->icon('heroicon-o-trash')
->color('danger') ->color('danger')
->requiresConfirmation() ->requiresConfirmation()
->action(fn () => $record->delete()), ->action(fn ($record) => $record->delete()),
]), ])
];
})
->headerActions([ ->headerActions([
Action::make('create') Action::make('create')
->label('Track Toevoegen') ->label('Track Toevoegen')