public function composeCsv(array $data = [], int $status = 200, array $config = []): SymfonyResponse
    {
        $filename = $config['filename'] ?? 'export';

        $collection = $this->convertToCsvable($data, $config);

        return Response::make($collection->toCsv(), $status, [
            'Content-Type' => 'text/csv',
            'Content-Disposition' => 'attachment; filename="'.$filename.'.csv"',
            'Cache-Control' => 'private',
            'pragma' => 'cache',
        ]);
    }
public function composeCsv(array $data = [], int $status = 200, array $config = []): SymfonyResponse
    {
        $filename = $config['filename'] ?? 'export';

        $collection = $this->convertToCsvable($data, $config);

        return Response::make($collection->toCsv(), $status, [
            'Content-Type' => 'text/csv',
            'Content-Disposition' => 'attachment; filename="'.$filename.'.csv"',
            'Cache-Control' => 'private',
            'pragma' => 'cache',
        ]);
    }
public function composeCsv ( array $ data = [ ] , int $ status = 200 , array $ config = [ ] ) : SymfonyResponse { $ filename = $ config [ 'filename' ] ?? 'export' ; $ collection = $ this -> convertToCsvable ( $ data , $ config ) ; return Response :: make ( $ collection -> toCsv ( ) , $ status , [ 'Content-Type' => 'text/csv' , 'Content-Disposition' => 'attachment; filename="' . $ filename . '.csv"' , 'Cache-Control' => 'private' , 'pragma' => 'cache' , ] ) ; }
Compose CSV.

@param  array  $data
@param  int  $status
@param  array  $config

@return \Symfony\Component\HttpFoundation\Response
Compose CSV .