public function getBairros(Request $request, $id) { if ($request->ajax()) { $bairros = Bairro::bairros($id); return response()->json($bairros); } }