I am setting record on my $removePaymentAction button inside foreach loop. When I click on that button, spinner show and then disappear and nothing happens. The record doesn't get deleted. Confirmation dialog also is not triggering. Can someone help?
Solution
Just to post an update how I solved this problem. The problem was my misuse of Filament actions.
I've created new Livewire component in which created filament table, just like the documentation says. I've passed my invoice record to the livewire via property.
// app/Livewire/InvoicePaymentsTable.phpclass InvoicePaymentsTable extends Component implements HasForms, HasTable{ use InteractsWithTable; use InteractsWithForms; public Invoice $invoice; public function table(Table $table): Table { return $table ->relationship(fn (): MorphMany => $this->invoice->payments()) ->inverseRelationship('payable') ->paginated(false) ->columns([ TextColumn::make('payed_at')->dateTime('d.m.Y'), TextColumn::make('amount'), ]) ->actions([ DeleteAction::make() ]); } public function render() { return <<<'blade' <div>{{ $this->table }}</div> blade; }}
// app/Livewire/InvoicePaymentsTable.phpclass InvoicePaymentsTable extends Component implements HasForms, HasTable{ use InteractsWithTable; use InteractsWithForms; public Invoice $invoice; public function table(Table $table): Table { return $table ->relationship(fn (): MorphMany => $this->invoice->payments()) ->inverseRelationship('payable') ->paginated(false) ->columns([ TextColumn::make('payed_at')->dateTime('d.m.Y'), TextColumn::make('amount'), ]) ->actions([ DeleteAction::make() ]); } public function render() { return <<<'blade' <div>{{ $this->table }}</div> blade; }}
And in the modal content view I called the livewire component like this: