Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

atalocke's avatar

Cannot get function to be called with wire:click in Volt

Hi, I'm trying to implement the bundled model component that comes with Livewire Breeze using the functional Volt and Blade API. I can't seem to figure out why my wire:click="toggleModal" call won't actually run. It just doesn't call the function. I've tried it with logging statements.

I'm using VS Code so I don't get much intellisense in Volt Blade files, and I can't seem to find any answers googling or asking AI in the past hour. Any help would be greatly appreciated.

0 likes
3 replies
Nakov's avatar

And what does your browser console says? So just open the browser's developer tools by inspecting the page and open the Console tab, there are probably some errors there.

Trying the simplest Volt component like this:

<?php

use function Livewire\Volt\{state};

state(['count' => 0]);

$increment = fn () => $this->count++;

?>

<div>
    <h1>{{ $count }}</h1>
    <button wire:click="increment">+</button>
</div>

should work fine.

atalocke's avatar

No errors. I think the issue is because my button and modal are in two different slots of the layout component, and despite trying with alpine or blade, it won't work. I tried to get @teleport working correctly too, but there I failed as well.

atalocke's avatar

I'm trying with an event now, but this doesn't seem to work either.

Please or to participate in this conversation.