<?php

namespace App\Http\Controllers\Reports;

use App\Classes\Modules\Reports\ControllersLogic\CustomcClearanceLogic;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Maatwebsite\Excel\Facades\Excel;

class CustomcClearanceReportController
{
    public function download(int $orderId, Request $request, CustomcClearanceLogic $customClearancelogic) {
        $request->merge(['orderId' => $orderId]);
        $filename = date("Y-m-d H:i:s")." - Custom cleared report ";
        $customClearancelogic->logic($request);
        return Excel::download( $customClearancelogic->getExcelCollection(), $filename.'.xlsx');
    }
}
