prefix code and write route

This commit is contained in:
2026-05-26 13:22:42 +03:30
parent e3b49ebbb3
commit 23dd62550d
6 changed files with 21 additions and 19 deletions

View File

@@ -3,6 +3,7 @@
namespace App\Http\Controllers\V3\Dashboard\Mission\Report;
use App\Exports\V3\Mission\Report\Tradod\CountryReport;
use App\Exports\V3\Mission\Report\Tradod\machineReport;
use App\Exports\V3\Mission\Report\Tradod\ProvinceReport;
use App\Http\Controllers\Controller;
use App\Http\Traits\ApiResponse;
@@ -21,14 +22,11 @@ class ReportMachineController extends Controller
{
use ApiResponse;
public function Activity(Request $request, ReportMachineService $reportMachineService): JsonResponse
public function activity(Request $request, ReportMachineService $reportMachineService): JsonResponse
{
return $this->successResponse([
'activities' => $reportMachineService->Activity($request),
'provinces' => Province::all(['id', 'name_fa']),
'code' => Mission::query()
->where('machine_code', $request->machine_code)
->get()
]);
}
@@ -36,12 +34,12 @@ class ReportMachineController extends Controller
* @throws Exception
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
*/
public function ExcelActivity(Request $request, ReportMachineService $reportMachineService): BinaryFileResponse
public function excelActivity(Request $request, ReportMachineService $reportMachineService): BinaryFileResponse
{
$data = $reportMachineService->Activity($request);
$name = 'گزارش کل تردد یک ماشین '.verta()->now()->format('Y-m-d H-i').'.xlsx';
return Excel::download(new CountryReport($data), $name);
return Excel::download(new machineReport($data), $name);
}
}