original_string: public function column($name, $label = '')
      {
          $relationName = $relationColumn = '';
  
          if (false !== strpos($name, '.')) {
              list($relationName, $relationColumn) = explode('.', $name);
  
              $relation = $this->model()->eloquent()->$relationName();
  
              $label = empty($label) ? ucfirst($relationColumn) : $label;
  
              $name = snake_case($relationName).'.'.$relationColumn;
          }
  
          $column = $this->addColumn($name, $label);
  
          if (isset($relation) && $relation instanceof Relation) {
              $this->model()->with($relationName);
              $column->setRelation($relationName, $relationColumn);
          }
  
          return $column;
      }
code: public function column($name, $label = '')
      {
          $relationName = $relationColumn = '';
  
          if (false !== strpos($name, '.')) {
              list($relationName, $relationColumn) = explode('.', $name);
  
              $relation = $this->model()->eloquent()->$relationName();
  
              $label = empty($label) ? ucfirst($relationColumn) : $label;
  
              $name = snake_case($relationName).'.'.$relationColumn;
          }
  
          $column = $this->addColumn($name, $label);
  
          if (isset($relation) && $relation instanceof Relation) {
              $this->model()->with($relationName);
              $column->setRelation($relationName, $relationColumn);
          }
  
          return $column;
      }
code_tokens: public function column ( $ name , $ label = '' ) { $ relationName = $ relationColumn = '' ; if ( false !== strpos ( $ name , '.' ) ) { list ( $ relationName , $ relationColumn ) = explode ( '.' , $ name ) ; $ relation = $ this -> model ( ) -> eloquent ( ) -> $ relationName ( ) ; $ label = empty ( $ label ) ? ucfirst ( $ relationColumn ) : $ label ; $ name = snake_case ( $ relationName ) . '.' . $ relationColumn ; } $ column = $ this -> addColumn ( $ name , $ label ) ; if ( isset ( $ relation ) && $ relation instanceof Relation ) { $ this -> model ( ) -> with ( $ relationName ) ; $ column -> setRelation ( $ relationName , $ relationColumn ) ; } return $ column ; }
docstring: Add column to Grid.
  
  @param string $name
  @param string $label
  
  @return Column
docstring_tokens: Add column to Grid .