FilamentF
Filament17mo ago
Sidem

livewire action

Hey,
I would like to know how to pass an action to my Livewire component. I would like when someone clicks on any div in my foreach, the ViewAction is used

Here is my code :
<div>
    <div class="container mx-auto p-4">
        <div class="flex flex-wrap justify-center gap-4">
            @foreach ($distribs as $distrib)
                <div class="flex-none w-60 p-4 bg-white shadow-md rounded distributor">
                    <img src="{{ asset($distrib->typeDistrib->image_path) }}" alt="image distributeur" class="w-full h-32 object-cover rounded mb-2">
                    <h2 class="text-xl font-bold">{{ $distrib->typeDistrib->title }}</h2>
                </div>
            @endforeach
        </div>
    </div>
</div>


Thanks !
Was this page helpful?