debug the accident module

This commit is contained in:
2025-08-30 14:07:37 +03:30
parent ab24f8502c
commit bb8262b896
7 changed files with 199 additions and 12 deletions

View File

@@ -12,6 +12,7 @@ use App\Services\Cartables\AccidentReceiptTableService;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Maatwebsite\Excel\Facades\Excel;
use PhpOffice\PhpSpreadsheet\Exception;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
class AccidentReceiptReportController extends Controller
@@ -38,6 +39,10 @@ class AccidentReceiptReportController extends Controller
]);
}
/**
* @throws Exception
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
*/
public function countryExcelReport(Request $request, AccidentReceiptTableService $accidentReceiptTableService): BinaryFileResponse
{
$data = $accidentReceiptTableService->countryReport($request);
@@ -45,6 +50,10 @@ class AccidentReceiptReportController extends Controller
return Excel::download(new CountryReport($data), $name);
}
/**
* @throws Exception
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
*/
public function provinceExcelReport(Request $request, AccidentReceiptTableService $accidentReceiptTableService): BinaryFileResponse
{
$data = $accidentReceiptTableService->provinceReport($request);