skip to Main Content

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

Answers


  1. 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.

    Login or Signup to reply.
  2. You must create livewire component first

    php artisan make:livewire CreatePost
    

    an update function into Livewire component.

    public function update(){...}
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search