namespace App\Http\Controllers\Admin\Operations\FluidbookCollection;
-
use App\Models\FluidbookAuditLink;
+use App\Models\FluidbookCollection;
use Cubist\Util\Files\Files;
use Illuminate\Support\Facades\Route;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
Route::match(['get','post'],$segment . '/{id}/export_excel', $controller . '@exportExcel')->name("download_audit_links");
}
- public function exportExcel() {
+ public function exportExcel($id) {
$errorlinks = FluidbookAuditLink::where('error_code','!=','')->get();
$redirectionlinks = FluidbookAuditLink::where('redirection_code','!=','')->get();
$writer = new Xlsx($excel);
$writer->save($tmpfile);
- $filename = "hemsley_fraser_audit_".date('Ymd').".xlsx";
+ $collection = FluidbookCollection::find($id);
+ $filename = "linksaudit_".$collection->title."_".time().".xlsx";
return response()->download($tmpfile, $filename)->deleteFileAfterSend();
}