public function edit($id, Request $request) { $user = $this->userRepository->search($id)->where('id', $id)->with('roles', 'carreras.semestres.materias')->get(); $carreras = Carrera::all(); $semestres = Semestre::all(); $materias = Materia::all(); $roles = Role::all(); $userMaterias = $this->userRepository->search($id); $detalles = ['user' => $user, 'carreras' => $carreras, 'semestres' => $semestres, 'materias' => $materias, 'roles' => $roles]; if ($request->ajax()) { return response()->json($detalles); } }
/** * Display a listing of the resource. * * @return Response */ public function index() { $semestre = Semestre::all(); return response()->json($semestre, 200); }