public function getIndex(Request $request) { header("Access-Control-Allow-Origin: *"); header("Allow: GET, POST, OPTIONS"); $colaborador = $request->input('colaborador'); if ($colaborador == null) { $users = User::all(); } else { $users = User::where('colaborador', $colaborador)->get(); } return $users; }