$this->service->paginated( ...$request->validatedWithDefaults(), filters: $request->only(['employment_status', 'is_active', 'gender']), ), 'filters' => $request->only(['employment_status', 'is_active', 'gender']), 'canViewAll' => $this->service->canViewAll(), ]); } public function create(): Response { return Inertia::render('admin/hr/employee/create', [ 'roles' => $this->roleService->getForEmployee(), 'canViewAll' => $this->service->canViewAll(), ]); } public function store(EmployeeRequest $request): RedirectResponse { return $this->handleAction( fn () => $this->service->store($request->validated()), 'Pegawai berhasil ditambahkan.', 'admin.hr.employees.index' ); } public function edit(User $user): Response { $user->load(['userProfile', 'employee', 'roles']); return Inertia::render('admin/hr/employee/edit', [ 'employee' => $user, 'roles' => $this->roleService->getForEmployee(), 'canViewAll' => $this->service->canViewAll(), ]); } public function update(EmployeeRequest $request, User $user): RedirectResponse { return $this->handleAction( fn () => $this->service->update($user, $request->validated()), 'Pegawai berhasil diperbarui.', 'admin.hr.employees.index' ); } public function destroy(User $user): RedirectResponse { return $this->handleAction( fn () => $this->service->destroy($user), 'Pegawai berhasil dihapus.', 'admin.hr.employees.index' ); } public function toggleActive(User $user): RedirectResponse { $employee = $this->service->toggleActive($user); $status = $employee->is_active ? 'diaktifkan' : 'dinonaktifkan'; Inertia::flash('toast', ['type' => 'success', 'message' => "Pegawai berhasil {$status}."]); return back(); } public function resetPassword(User $user): RedirectResponse { return $this->handleAction( fn () => $this->service->resetPassword($user), 'Kata sandi pegawai berhasil direset ke kata sandi default.', 'admin.hr.employees.index' ); } }