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());
    }
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());
    }
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 ( ) ) ; }
Updates a components ordering.

@return array
Updates a components ordering .