route('home.country', ['country' => 'my']); } public function country(Request $request, $country) { $country = CountryLocale::where('slug', $country)->first(); if (!is_null($country)) { $categories = Category::where('country_locale_id', $country->id)->get(); return view('front.country', ['categories' => $categories, 'country' => $country]); } return redirect()->route('home.country', ['country' => 'my']); } }