public function show(Request $request, $section = 'settings')
{
// remove & move code
$settingsSection = ['settings' => ['title' => xe_trans('xe::defaultSettings'), 'content' => function ($user) {
return $this->userEditView($user);
}]];
// get sections
$menus = $this->handler->getSettingsSections();
// add default settings section
$menus = array_merge($settingsSection, $menus);
// get Selected section
if (isset($menus[$section]) === false) {
throw new NotFoundHttpException();
}
$selectedSection = $menus[$section];
if ($selectedSection === null) {
$selectedSection = reset($menus);
}
// get current user
$user = $this->user;
$content = $selectedSection['content'];
$tabContent = $content instanceof \Closure ? $content($user) : $content;
return XePresenter::make('index', compact('user', 'menus', 'tabContent'));
}