get('user.SortMenu.C2'); $form = (new Modal('/etc/common/user-menu'))->getData(); $currentBpa = Utils::bpaDecoding(request('bpa')); try { $menuPage = Utils::getMainMenu($sortType)['Page'] ?? []; } catch (Exception $e) { $menuPage = []; } $bpa = Utils::bpaEncoding($menuPage)->pluck('bpa')->toArray(); $menuPage = collect($menuPage)->map(function ($menu, $index) use ($bpa) { return array_merge($menu, ['bpa' => $bpa[$index]]); }); return view('components.right-side-bar-component', compact('form', 'currentBpa', 'menuPage')); } }