How to change action view based on arguments?

Is it possible to use tap to apply multiple options or does Filament have another way?
Action::make('test')
->tap(function (Action $action) {
$arguments = $action->getArguments();
if (isset($arguments['type']) && $arguments['type'] === 'button') {
$action->grouped()->groupedIcon('heroicon-o-chevron-right');
} else {
$action->button()->color('primary');
}
})
Action::make('test')
->tap(function (Action $action) {
$arguments = $action->getArguments();
if (isset($arguments['type']) && $arguments['type'] === 'button') {
$action->grouped()->groupedIcon('heroicon-o-chevron-right');
} else {
$action->button()->color('primary');
}
})
Arguments is always null
@if ($displayActionButton)
{{ ($this->testAction)(['type' => 'button']) }}
@else
{{ $this->testAction }}
@endif
@if ($displayActionButton)
{{ ($this->testAction)(['type' => 'button']) }}
@else
{{ $this->testAction }}
@endif
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server