I am using laravel livewire 3 get page not found

256 Views Asked by At

when click I get page not found and in consle error : POST http://localhost/livewire/update 404 (Not Found)

counter.blade.php

<div>
    <h1>{{ $this->count }}</h1>

    <button wire:click="increment">+</button>

    <button wire:click="decrement">-</button>
</div>

in blade I have the following :

@section('custom-js')
     @livewireScripts
@endsection

@section('custom-css')
    @livewireStyles
@endsection


<livewire:counter />

when click on increment or decrement I get page not found

2

There are 2 best solutions below

0
Ayoub ASSAOUD On

If you are using Livewire3, then no need to inject css & javascript of livewire assets manualy, because they are automaticaly injected.

check this documentation page to see.

1
Freddy Caicedo On

You must create livewire component first

php artisan make:livewire CreatePost

an update function into Livewire component.

public function update(){...}