user('web'); abort_unless($actor instanceof User, 403); $filters = $request->validate(['page' => 'nullable|integer|min:1|max:1000000', 'history' => 'nullable|uuid', 'history_page' => 'nullable|integer|min:1|max:1000000', 'origins_page' => 'nullable|integer|min:1|max:1000000', 'receipts_page' => 'nullable|integer|min:1|max:1000000']); $props = $service->workspace($actor, $filters['history'] ?? null); Inertia::encryptHistory(); $response = Inertia::render('equipment/capital-register', $props)->toResponse($request); $response->headers->set('Cache-Control', 'private, no-store, max-age=0'); return $response; } public function store(Request $request, CapitalRegister $service): Response { $actor = $request->user('web'); abort_unless($actor instanceof User, 403); $service->save($actor, $request->all()); return back()->with('success', 'Versão do cadastro preservada.'); } public function assignments(Request $request, Requisition $requisition, CapitalAssignments $service): Response { $actor = $request->user('web'); abort_unless($actor instanceof User, 403); $request->validate(['choices_page' => 'nullable|integer|min:1|max:1000000', 'history_page' => 'nullable|integer|min:1|max:1000000']); Inertia::encryptHistory(); $response = Inertia::render('requisitions/capital-assignments', $service->workspace($actor, $requisition))->toResponse($request); $response->headers->set('Cache-Control', 'private, no-store, max-age=0'); return $response; } public function assign(Request $request, Requisition $requisition, CapitalAssignments $service): Response { $actor = $request->user('web'); abort_unless($actor instanceof User, 403); $service->save($actor, $requisition, $request->all()); return back()->with('success', 'Ligação documental preservada.'); } }