Add Action group in a custom infolist layout

I have a custom infolist layout which doing a for loop. And on each item there is a button that will do something with the item on the loop. The error occurs when I click the button ("Confirm"), it says App\Livewire\Modals\BillingCustomerInvoiceList::getInfolist(): Argument #1 ($name) must be of type string, null given. Any workarounds? This is the custom layout I have
<div>
@if ($this->invoices->isNotEmpty())
@foreach ($this->invoices as $invoice)
<div class="flex flex-row gap-2 rounded-lg bg-gray-900 mx-2 p-4">
<div class="grow flex flex-col gap-2">
...
</div>
<div class="grow-0 flex flex-col">
{{ $this->confirmAction($invoice->id) }}
</div>
</div>
@endforeach
@else
<div class="flex flex-col items-center justify-center">
Unavailable
</div>
@endif

<x-filament-actions::modals />
</div>
<div>
@if ($this->invoices->isNotEmpty())
@foreach ($this->invoices as $invoice)
<div class="flex flex-row gap-2 rounded-lg bg-gray-900 mx-2 p-4">
<div class="grow flex flex-col gap-2">
...
</div>
<div class="grow-0 flex flex-col">
{{ $this->confirmAction($invoice->id) }}
</div>
</div>
@endforeach
@else
<div class="flex flex-col items-center justify-center">
Unavailable
</div>
@endif

<x-filament-actions::modals />
</div>
And this is the confirmAction() on the main infolist modal
public function confirmAction(int $invoiceId): ActionGroup
{
return ActionGroup::make([
Action::make('confirm_action')
->label('Confirm')
->requiresConfirmation()
->action(function () {
dd('confirm');
})
]);
}
public function confirmAction(int $invoiceId): ActionGroup
{
return ActionGroup::make([
Action::make('confirm_action')
->label('Confirm')
->requiresConfirmation()
->action(function () {
dd('confirm');
})
]);
}
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server