public function getTowns(Request $request, $id) { if ($request->ajax()) { $towns = Town::towns($id); return response()->json($towns); } }