JezK
Edit File: GridExportDetail.php
<?php namespace App\Exports; use Illuminate\Support\Facades\DB; use Maatwebsite\Excel\Concerns\FromCollection; use Maatwebsite\Excel\Concerns\Exportable; use Maatwebsite\Excel\Concerns\WithHeadings; class GridExportDetail implements FromCollection, WithHeadings { use Exportable; public function headings(): array { return ['IDENTIFICADOR', 'CLIENTE', 'DE', 'ASUNTO', 'CELULAR', 'LARGO', 'OPERADOR', 'NRO_ENVIO', 'FEC_ENVIO', 'HORA_ENVIO', 'FEC_ENTREGA', 'HORA_ENTREGA', 'ESTADO_ENVIO', 'LOG']; } public function forIdentificador(string $identificador) { $this->identificador = $identificador; return $this; } public function collection() { $solicitudes = DB::connection('mysql_dconsulting') ->table('DETALLE_BANBIF') ->where([ ['IDENTIFICADOR', '=', $this->identificador] ]); $solicitudes = $solicitudes->get(['IDENTIFICADOR', 'CLIENTE', 'DE', 'ASUNTO', 'CELULAR', 'LARGO', 'OPERADOR', 'NRO_ENVIO', 'FEC_ENVIO', 'HORA_ENVIO', 'FEC_ENTREGA', 'HORA_ENTREGA', 'ESTADO_ENVIO', 'LOG']); return $solicitudes; } }