orderBy('study_date', 'desc') ->paginate(15); return view('staff.studies.index', compact('studies')); } public function details() { $this->decodeKeys(); $study = Study::with(['series', 'details'])->findOrFail($this->key); //return view('staff.studies.details', compact('study')); return response()->json($study); } }