0
votes

I have one button in livewire view

<x-jet-button wire:click.prevent="confirmProcess" class="bg-blue-500 hover:bg-blue-700">
Next
</x-jet-button>

and here in controller my method

public function confirmProcess()
{
    return view('livewire.confirm');
}

I also have view in livewire folder with name confirm.blade.php

I want to load different view on button click but when I click on button nothing happens.

how can I load other view also I want to use data from same controller also on other view.

Thanks

1

1 Answers

1
votes

You can't return view from your confirmProcess method. What you can do is redirect from confirmProcess method to a named route like:

return redirect()->route('confirm');

Then from this route you can call the component like:

Route::get('/confirm-process', \App\Http\Livewire\Confirm::class)->name('confirm');