user(); // The role and status selects are disabled on the profile, so only the // user's own role is offered rather than the full list. $roles = $this->roles->all() ->filter(fn ($role) => $role->id == $user->role_id) ->pluck('display_name', 'id'); $forcePasswordChange = $passwordChangeManager->isPasswordChangeForcedForUser($user); return Inertia::render('Profile', [ 'user' => UserPayload::form($user), 'roles' => Options::fromList($roles), 'countries' => Options::fromList( [0 => __('Select a Country')] + $this->countries->lists()->toArray() ), 'statuses' => Options::fromList(UserStatus::lists()), 'avatarSources' => UserPayload::avatarSources( $user, $this->users->getUserSocialLogins($user->id) ), 'twoFactor' => UserPayload::twoFactor($user), 'forcePasswordChange' => $forcePasswordChange, 'activeTab' => $forcePasswordChange ? 'login' : (session('tab') ?? 'details'), ]); } }