src/Traits/ExportsCollection.php
public function export(Builder $query, $format)
    {
        $method = 'to'.strtoupper($format);

        if (method_exists($this, $method)) {
            return call_user_func_array([$this, $method], [$query]);
        }

        if (method_exists($this->module, $method)) {
            return call_user_func_array([$this->module, $method], [$query]);
        }

        throw new Exception(sprintf('Don\'t know how to export to %s format.', $format));
    }
public function export(Builder $query, $format)
    {
        $method = 'to'.strtoupper($format);

        if (method_exists($this, $method)) {
            return call_user_func_array([$this, $method], [$query]);
        }

        if (method_exists($this->module, $method)) {
            return call_user_func_array([$this->module, $method], [$query]);
        }

        throw new Exception(sprintf('Don\'t know how to export to %s format.', $format));
    }
public function export ( Builder $ query , $ format ) { $ method = 'to' . strtoupper ( $ format ) ; if ( method_exists ( $ this , $ method ) ) { return call_user_func_array ( [ $ this , $ method ] , [ $ query ] ) ; } if ( method_exists ( $ this -> module , $ method ) ) { return call_user_func_array ( [ $ this -> module , $ method ] , [ $ query ] ) ; } throw new Exception ( sprintf ( 'Don\'t know how to export to %s format.' , $ format ) ) ; }
Export collection to a specific format.

@param Builder $query
@param         $format

@return mixed
@throws Exception
Export collection to a specific format .