I have this function in one of my controller.
public function tourList($country, $category)
{
$tour = Tour::whereHas('country', function($q) {
$q->where('name','=', $country);
})
->whereHas('category', function($r) {
$r->where('name','=', $category);
})
->get();
return view('tour-list.blade.php')->withTour('$tour');
}
Though have passed two variables from get method. But i am getting error of
Undefined variable: country