original_string: public function postUpdateComponentOrder()
      {
          $componentData = Binput::get('ids');
  
          foreach ($componentData as $order => $componentId) {
              try {
                  $component = Component::find($componentId);
  
                  execute(new UpdateComponentCommand(
                      $component,
                      $component->name,
                      $component->description,
                      $component->status,
                      $component->link,
                      $order + 1,
                      $component->group_id,
                      $component->enabled,
                      $component->meta,
                      true
                  ));
              } catch (QueryException $e) {
                  throw new BadRequestHttpException();
              }
          }
  
          return $this->collection(Component::query()->orderBy('order')->get());
      }
code: public function postUpdateComponentOrder()
      {
          $componentData = Binput::get('ids');
  
          foreach ($componentData as $order => $componentId) {
              try {
                  $component = Component::find($componentId);
  
                  execute(new UpdateComponentCommand(
                      $component,
                      $component->name,
                      $component->description,
                      $component->status,
                      $component->link,
                      $order + 1,
                      $component->group_id,
                      $component->enabled,
                      $component->meta,
                      true
                  ));
              } catch (QueryException $e) {
                  throw new BadRequestHttpException();
              }
          }
  
          return $this->collection(Component::query()->orderBy('order')->get());
      }
code_tokens: public function postUpdateComponentOrder ( ) { $ componentData = Binput :: get ( 'ids' ) ; foreach ( $ componentData as $ order => $ componentId ) { try { $ component = Component :: find ( $ componentId ) ; execute ( new UpdateComponentCommand ( $ component , $ component -> name , $ component -> description , $ component -> status , $ component -> link , $ order + 1 , $ component -> group_id , $ component -> enabled , $ component -> meta , true ) ) ; } catch ( QueryException $ e ) { throw new BadRequestHttpException ( ) ; } } return $ this -> collection ( Component :: query ( ) -> orderBy ( 'order' ) -> get ( ) ) ; }
docstring: Updates a components ordering.
  
  @return array
docstring_tokens: Updates a components ordering .