© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
2 replies
Kanalaetxebarria

Trigger delete action on custom layout for table

Hi, I'm trying to render a resource that contains only images as an image gallery. I've made a custom ListRecords view, where I'm displaying the records in my custom layout:

@foreach ($this->table->getRecords() as $key => $record)
            {{-- @dd(get_class_methods($record)) --}}
            <div class="overflow-hidden aspect-square">
                <button type="button" wire:loading.attr="disabled"
                    wire:click="mountTableAction('delete', {{ $key + 1 }})">Delete</button>
                <img src="{{ asset($record->portfolio_image) }}" alt="" class="w-full h-full object-cover">
            </div>
        @endforeach
@foreach ($this->table->getRecords() as $key => $record)
            {{-- @dd(get_class_methods($record)) --}}
            <div class="overflow-hidden aspect-square">
                <button type="button" wire:loading.attr="disabled"
                    wire:click="mountTableAction('delete', {{ $key + 1 }})">Delete</button>
                <img src="{{ asset($record->portfolio_image) }}" alt="" class="w-full h-full object-cover">
            </div>
        @endforeach


I'm trying to get the delete action to work. I've copied what I see on the markup from the other resource's delete action button. I see that I'm triggering a request through the network when clicking the delete button on my custom layout, but I don't get any kind of delete confirmation modal and the record doesn't delete.
I've tried passing the record id, the key without + 1, read through the vendor files but can't seem to figure it out.

How can I delete the records?

Thanks!
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Custom Table Layout
FilamentFFilament / ❓┊help
2y ago
Custom Table Layout
FilamentFFilament / ❓┊help
3y ago
Table Delete Action Issue
FilamentFFilament / ❓┊help
13mo ago
Delete Action Table Repeater.
FilamentFFilament / ❓┊help
16mo ago