src/Exportable.php
protected function prepareCollection()
    {
        $need_conversion = false;
        $first_row = $this->data->first();

        if (!$first_row) {
            return;
        }

        foreach ($first_row as $item) {
            if (!is_string($item)) {
                $need_conversion = true;
            }
        }
        if ($need_conversion) {
            $this->transform();
        }
    }
protected function prepareCollection()
    {
        $need_conversion = false;
        $first_row = $this->data->first();

        if (!$first_row) {
            return;
        }

        foreach ($first_row as $item) {
            if (!is_string($item)) {
                $need_conversion = true;
            }
        }
        if ($need_conversion) {
            $this->transform();
        }
    }
protected function prepareCollection ( ) { $ need_conversion = false ; $ first_row = $ this -> data -> first ( ) ; if ( ! $ first_row ) { return ; } foreach ( $ first_row as $ item ) { if ( ! is_string ( $ item ) ) { $ need_conversion = true ; } } if ( $ need_conversion ) { $ this -> transform ( ) ; } }
Prepare collection by removing non string if required.
Prepare collection by removing non string if required .