original_string: public function postUpdateComponentGroupOrder()
      {
          $groupData = Binput::get('ids');
  
          foreach ($groupData as $order => $groupId) {
              $group = ComponentGroup::find($groupId);
  
              execute(new UpdateComponentGroupCommand(
                  $group,
                  $group->name,
                  $order + 1,
                  $group->collapsed,
                  $group->visible
              ));
          }
  
          return $this->collection(ComponentGroup::query()->orderBy('order')->get());
      }
code: public function postUpdateComponentGroupOrder()
      {
          $groupData = Binput::get('ids');
  
          foreach ($groupData as $order => $groupId) {
              $group = ComponentGroup::find($groupId);
  
              execute(new UpdateComponentGroupCommand(
                  $group,
                  $group->name,
                  $order + 1,
                  $group->collapsed,
                  $group->visible
              ));
          }
  
          return $this->collection(ComponentGroup::query()->orderBy('order')->get());
      }
code_tokens: public function postUpdateComponentGroupOrder ( ) { $ groupData = Binput :: get ( 'ids' ) ; foreach ( $ groupData as $ order => $ groupId ) { $ group = ComponentGroup :: find ( $ groupId ) ; execute ( new UpdateComponentGroupCommand ( $ group , $ group -> name , $ order + 1 , $ group -> collapsed , $ group -> visible ) ) ; } return $ this -> collection ( ComponentGroup :: query ( ) -> orderBy ( 'order' ) -> get ( ) ) ; }
docstring: Updates the order of component groups.
  
  @return array
docstring_tokens: Updates the order of component groups .