. */ use Modules\Impianti\Export\CSV; use Modules\Impianti\Impianto; include_once __DIR__.'/../../core.php'; switch (post('op')) { case 'export-csv': $file = temp_file(); $exporter = new CSV($file); // Esportazione dei record selezionati $fatture = Impianto::whereIn('id', $id_records)->get(); $exporter->setRecords($fatture); $count = $exporter->exportRecords(); download($file, 'impianti.csv'); break; } if (App::debug()) { $operations['export-csv'] = [ 'text' => ' '.tr('Esporta selezionati').' beta', 'data' => [ 'msg' => tr('Vuoi davvero esportare un CSV con tutti gli impianti?'), 'button' => tr('Procedi'), 'class' => 'btn btn-lg btn-danger', 'blank' => true, ], ]; } return $operations;