/** * * @param int $countryId * @return $tours */ public function getToursByCountry($countryId, $perPage = 10) { return Tour::whereHas('countries', function ($query) use($countryId) { $query->where('country_id', $countryId); })->orderBy('id', 'desc')->paginate($perPage); }