damarev
damarev
FFilament
Created by damarev on 6/6/2024 in #❓┊help
$getAction() with arguments
Is it possible to render a Infolists\Components\Actions\Action registered on a Infolists\Components\Entry via $this->registerActions(), passing arguments from the view? I have:
class TranslationsInfo extends \Filament\Infolists\Components\Entry
{
protected string $view = 'infolists.components.translations-info';
protected function setUp(): void
{
parent::setUp();
$this->registerActions([
Action::make('myAction')
->action(function (array $arguments) {
dump($arguments['language']);
})
]);
}
}
class TranslationsInfo extends \Filament\Infolists\Components\Entry
{
protected string $view = 'infolists.components.translations-info';
protected function setUp(): void
{
parent::setUp();
$this->registerActions([
Action::make('myAction')
->action(function (array $arguments) {
dump($arguments['language']);
})
]);
}
}
I have tried with no result:
{{ $getAction('myAction', ['language' => 'es']) }}
{{ $getAction('myAction')->arguments(['language' => 'es']) }}
{{ $getAction('myAction')(['language' => 'es']) }}
{{ ($this->myAction)(['language' => 'es']) }}
{{ $getAction('myAction', ['language' => 'es']) }}
{{ $getAction('myAction')->arguments(['language' => 'es']) }}
{{ $getAction('myAction')(['language' => 'es']) }}
{{ ($this->myAction)(['language' => 'es']) }}
31 replies