caseService = $caseService; } public function index() { $documents = $this->caseService->pendingForUser(Auth::user()) ->paginate(10) ->withQueryString() ->onEachSide(1); return Inertia::client('Dashboard/Documents/Index', [ 'documents' => CaseResource::collection($documents), ]); } public function show(Document $document) { return redirect()->route('dashboard.cases.show', $document); } }