/** * Show the edit form for a user. * * @param int $userId * * @return \Illuminate\View\View */ public function edit($userId) { if (!($user = $this->users->findByKey($userId))) { return $this->notFound(); } try { $this->users->checkPermissions($user); } catch (AccessDeniedException $e) { $this->addWarningMessage(Lang::get('c::auth.access-denied')); } $viewData = ['pageTitle' => Lang::get('c::user.admin-edituser'), 'user' => $user, 'isActive' => (bool) $user->is_active, 'userTypes' => $this->getUserTypes(), 'formAction' => $this->url('update', [$user->id]), 'deleteUrl' => $this->url('delete', [$user->id]), 'restoreUrl' => $user->deleted_at ? $this->url('restore', [$user->id]) : null, 'backUrl' => $this->url('index')]; return $this->view('c::user.form', $viewData); }