exportarPedidosAPdf(); } public function exportarPedidoACSV(GrupoDeCompra $gdc): BinaryFileResponse { $gdc->exportarPedidoEnCSV(); $pattern = storage_path('csv/exports/'. $gdc->nombre . '-*.csv'); $files = glob($pattern); usort($files, function ($a, $b) { return filemtime($b) <=> filemtime($a); }); return response()->download($files[0]); } public function exportarPedidoConNucleosACSV(GrupoDeCompra $gdc): BinaryFileResponse { $gdc->exportarPedidoConNucleosEnCSV(); $pattern = storage_path('csv/exports/'.$gdc->nombre.'-completo-*.csv'); $files = glob($pattern); usort($files, function ($a, $b) { return filemtime($b) <=> filemtime($a); }); return response()->download($files[0]); } }