Level 2
I used the session object instead...
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
How do I pass model search query parameters from Livewire component to Laravel Excel route ?
Livewire component:
public $search = '';
public function render()
{
'posts' =>Post::where('description', 'like', '%'.$this->search.'%')
->get()
}
Laravel Excel route inside same Livewire component:
public function export()
{
return Excel::download(new PostsExport, 'posts.xlsx');
}
Setting public variables on the component will not work since the routes are stateless.
Please or to participate in this conversation.