Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I needed for my project the livewire package in, but have not used before. Some livewire components do not work without refreshing the page, i did not understand the reason for this.

<form wire:submit.prevent="login_method">
    <input type="text" wire:model="login.email" id="email">
    <input type="password" wire:model="login.password" id="password">
    <button type="submit">Login</button>
</form>
class Login extends Component
{
    public $login;

    public function login()
    {
        return dd($this->$login);
    }
    
    public function render()
    {
        return view('livewire.auth.login')->extends('layout.default');
    }
}

Note: I use Turbolinks (SPA). To switch between pages without refreshing the browser.

When I disable Turbolinks, form submission works, but when Turbolinks is active, livewire components are loaded when switching between pages, but the actions do not work.

Laravel 8.12 / Livewire 2.3 / Turbolinks 5.2

question from:https://stackoverflow.com/questions/66058207/laravel-form-submit-not-working-livewire-turbolinks

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
720 views
Welcome To Ask or Share your Answers For Others

1 Answer

Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...