How do I use the same render in 2 separate view functions using the if route is condition? (Laravel/Livewire)??
I want to render 2 different Livewire.view in the render function by checking the route is same to current route, something like that:
public function render()
{
if (\Route::named('admin-appointments')) {
return view('livewire.admin-appointments', [
'data' => $this->read(),
]);
}
else{
return view('livewire.user-appointments', [
'data' => $this->read(),
]);
}
}
but I have alwayse problem!!