original_string: public function update(Component $component)
      {
          try {
              execute(new UpdateComponentCommand(
                  $component,
                  Binput::get('name'),
                  Binput::get('description'),
                  Binput::get('status'),
                  Binput::get('link'),
                  Binput::get('order'),
                  Binput::get('group_id'),
                  Binput::get('enabled', $component->enabled),
                  Binput::get('meta', null),
                  (bool) Binput::get('silent', false)
              ));
          } catch (QueryException $e) {
              throw new BadRequestHttpException();
          }
  
          if (Binput::has('tags')) {
              $component->tags()->delete();
  
              // The component was added successfully, so now let's deal with the tags.
              Collection::make(preg_split('/ ?, ?/', $tags))->map(function ($tag) {
                  return trim($tag);
              })->map(function ($tag) {
                  return execute(new CreateTagCommand($tag));
              })->each(function ($tag) use ($component) {
                  execute(new ApplyTagCommand($component, $tag));
              });
          }
  
          return $this->item($component);
      }
code: public function update(Component $component)
      {
          try {
              execute(new UpdateComponentCommand(
                  $component,
                  Binput::get('name'),
                  Binput::get('description'),
                  Binput::get('status'),
                  Binput::get('link'),
                  Binput::get('order'),
                  Binput::get('group_id'),
                  Binput::get('enabled', $component->enabled),
                  Binput::get('meta', null),
                  (bool) Binput::get('silent', false)
              ));
          } catch (QueryException $e) {
              throw new BadRequestHttpException();
          }
  
          if (Binput::has('tags')) {
              $component->tags()->delete();
  
              // The component was added successfully, so now let's deal with the tags.
              Collection::make(preg_split('/ ?, ?/', $tags))->map(function ($tag) {
                  return trim($tag);
              })->map(function ($tag) {
                  return execute(new CreateTagCommand($tag));
              })->each(function ($tag) use ($component) {
                  execute(new ApplyTagCommand($component, $tag));
              });
          }
  
          return $this->item($component);
      }
code_tokens: public function update ( Component $ component ) { try { execute ( new UpdateComponentCommand ( $ component , Binput :: get ( 'name' ) , Binput :: get ( 'description' ) , Binput :: get ( 'status' ) , Binput :: get ( 'link' ) , Binput :: get ( 'order' ) , Binput :: get ( 'group_id' ) , Binput :: get ( 'enabled' , $ component -> enabled ) , Binput :: get ( 'meta' , null ) , ( bool ) Binput :: get ( 'silent' , false ) ) ) ; } catch ( QueryException $ e ) { throw new BadRequestHttpException ( ) ; } if ( Binput :: has ( 'tags' ) ) { $ component -> tags ( ) -> delete ( ) ; // The component was added successfully, so now let's deal with the tags. Collection :: make ( preg_split ( '/ ?, ?/' , $ tags ) ) -> map ( function ( $ tag ) { return trim ( $ tag ) ; } ) -> map ( function ( $ tag ) { return execute ( new CreateTagCommand ( $ tag ) ) ; } ) -> each ( function ( $ tag ) use ( $ component ) { execute ( new ApplyTagCommand ( $ component , $ tag ) ) ; } ) ; } return $ this -> item ( $ component ) ; }
docstring: Update an existing component.
  
  @param \CachetHQ\Cachet\Models\Component $component
  
  @return \Illuminate\Http\JsonResponse
docstring_tokens: Update an existing component .