public function detailsJSON($lang, $id)
    {
        // check if user has permissions to access this link
        if(!User::hasAccess('Menu', 'read')) {
            return $this->noPermission();
        }
        // get selected menu
        $menu = Menu::findByID($id);

        // TODO me i marr te dhanat e menu linkave prej cachit
        $this->existingMenuLinks = MenuLink::where('menuID', $id)->orderBy("order", "ASC")->get()->toArray();
        $convertedMenuLinks = $this->convertToParentChild($this->existingMenuLinks);
        $convertedMenuLinks = $this->filterParents($convertedMenuLinks);

        $final = array(
            'list' => $convertedMenuLinks,
            'menu' => $menu,
            'languages' => Language::all()
        );

        // Fire event
        $final['events'] = Event::fire('menu:pre_update', [$final]);

        return $final;
    }
public function detailsJSON($lang, $id)
    {
        // check if user has permissions to access this link
        if(!User::hasAccess('Menu', 'read')) {
            return $this->noPermission();
        }
        // get selected menu
        $menu = Menu::findByID($id);

        // TODO me i marr te dhanat e menu linkave prej cachit
        $this->existingMenuLinks = MenuLink::where('menuID', $id)->orderBy("order", "ASC")->get()->toArray();
        $convertedMenuLinks = $this->convertToParentChild($this->existingMenuLinks);
        $convertedMenuLinks = $this->filterParents($convertedMenuLinks);

        $final = array(
            'list' => $convertedMenuLinks,
            'menu' => $menu,
            'languages' => Language::all()
        );

        // Fire event
        $final['events'] = Event::fire('menu:pre_update', [$final]);

        return $final;
    }
public function detailsJSON ( $ lang , $ id ) { // check if user has permissions to access this link if ( ! User :: hasAccess ( 'Menu' , 'read' ) ) { return $ this -> noPermission ( ) ; } // get selected menu $ menu = Menu :: findByID ( $ id ) ; // TODO me i marr te dhanat e menu linkave prej cachit $ this -> existingMenuLinks = MenuLink :: where ( 'menuID' , $ id ) -> orderBy ( "order" , "ASC" ) -> get ( ) -> toArray ( ) ; $ convertedMenuLinks = $ this -> convertToParentChild ( $ this -> existingMenuLinks ) ; $ convertedMenuLinks = $ this -> filterParents ( $ convertedMenuLinks ) ; $ final = array ( 'list' => $ convertedMenuLinks , 'menu' => $ menu , 'languages' => Language :: all ( ) ) ; // Fire event $ final [ 'events' ] = Event :: fire ( 'menu:pre_update' , [ $ final ] ) ; return $ final ; }
Create a menu link parent child relation array.

@param  string $lang
@param  int    $id
@return array
@throws \Exception
Create a menu link parent child relation array .