Redirect error livewire #8443
Replies: 1 comment
-
this script is my problem , resolved |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using Laravel 11 and Livewire 3.4
In my component home I have the following code
`
When clicking the button it executes the searchJob function
public function searchJob(){ $this->redirectRoute('searchJob', ['searchTerm' => $this->searchTerm], true,true); }
Em minhas rotas tenho o seguinte
Route::get('/search-jobs/{searchTerm}', App\Livewire\SearchJob::class)->name('searchJob');
This is my searchJob component
`use Livewire\Component;
use Livewire\Attributes\Url;
class SearchJob extends Component
{
#[Url]
public $searchTerm;
}`
The problem is that when I use "true" in my redirect to not reload the page it updates the url, however it renders a page with the current year
<html><head></head><body>2024</body></html>
If I refresh the page it works normally.
The error occurs with $this->redirect() e $this->redirectRoute()
I hope someone can help me.
this is my app.blade
`
Beta Was this translation helpful? Give feedback.
All reactions