public function updateOrder(Request $request, $type = 'list')
    {
        $this->updateNavType($type);

        $navigation = json_decode($request->get('list'), true);

        foreach ($navigation as $key => $nav) {

            $idd = $this->defaultParent ? $this->defaultParent->id : 0;
            $row = $this->updateNavigationListOrder($nav['id'], ($key + 1), $idd);

            $this->updateIfNavHasChildren($nav);
        }

        return ['result' => 'success'];
    }
public function updateOrder(Request $request, $type = 'list')
    {
        $this->updateNavType($type);

        $navigation = json_decode($request->get('list'), true);

        foreach ($navigation as $key => $nav) {

            $idd = $this->defaultParent ? $this->defaultParent->id : 0;
            $row = $this->updateNavigationListOrder($nav['id'], ($key + 1), $idd);

            $this->updateIfNavHasChildren($nav);
        }

        return ['result' => 'success'];
    }
public function updateOrder ( Request $ request , $ type = 'list' ) { $ this -> updateNavType ( $ type ) ; $ navigation = json_decode ( $ request -> get ( 'list' ) , true ) ; foreach ( $ navigation as $ key => $ nav ) { $ idd = $ this -> defaultParent ? $ this -> defaultParent -> id : 0 ; $ row = $ this -> updateNavigationListOrder ( $ nav [ 'id' ] , ( $ key + 1 ) , $ idd ) ; $ this -> updateIfNavHasChildren ( $ nav ) ; } return [ 'result' => 'success' ] ; }
Update the order of navigation

@param string  $type
@param Request $request
@return array
Update the order of navigation