#wire:click don't call function

6 messages · Page 1 of 1 (latest)

gray pond
#

Hi, I don't know why, my wire:click don't call the function.

Here's the blade button ```html
<button wire:click="acceptSkin({{ $skin->id }})" class="px-4 h-12 text-primary goldGradient transition-all hover:rounded-sm rounded-md text-md min-[750px]:text-xl hover:brightness-110">Accepter</button>

And the php ```php
    public function acceptSkin($skinID)
    {
        dd('acceptSkin');
        $skin = Skin::find($skinID);

        $skin->update([
            'status' => 'Posted'
        ]);

        $skin->User->notify(new SkinPostedNotification($skin));
    }
``` It don't do anything, my blade file start with an empty div, if you feel the need to see more, I link the entier php and blade file, the 'acceptSkin' function is at line 66, and the button line 123

The livewire component is called here ```html
                @can('validate-skin')
                    <div x-show="currentPage == 'skins-validation'"
                         x-transition:enter="transition ease-out duration-300"
                         x-transition:enter-start="opacity-0 -translate-y-8"
                         x-transition:enter-end="opacity-100">
                        <livewire:user-panel.skins-validation :wire:key="'skins-validation-{{ rand() }}'"/>
                    </div>
                @endcan
dreamy summit
#

Livewire scripts are loaded?

gray pond
inner fossil
#

should just be wire:key instead of :wire:key ?

gray pond
gray pond
#

Ok so update, weird situation, if I move my component ```html
<livewire:user-panel.skins-validation wire:key="'skins-validation-{{ rand() }}'"/>