create transportation unit cartable

This commit is contained in:
2025-05-19 09:18:32 +03:30
parent f756b9adbe
commit ece2d687cd
9 changed files with 153 additions and 62 deletions

View File

@@ -8,6 +8,7 @@ use App\Http\Controllers\Controller;
use App\Http\Requests\V3\SafetyAndPrivacy\RejectRequest;
use App\Http\Traits\ApiResponse;
use App\Models\SafetyAndPrivacy;
use App\Services\Cartables\SafetyAndPrivacy\SupervisorService;
use App\Services\Cartables\SafetyAndPrivacyTableService;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
@@ -22,18 +23,18 @@ class SupervisorController extends Controller
/**
* @throws Throwable
*/
public function index(Request $request, SafetyAndPrivacyTableService $safetyAndPrivacyTableService): JsonResponse
public function index(Request $request, SupervisorService $supervisorService): JsonResponse
{
return response()->json($safetyAndPrivacyTableService->supervisorDataTable($request));
return response()->json($supervisorService->dataTable($request));
}
/**
* @throws Throwable
*/
public function excelReport(Request $request, SafetyAndPrivacyTableService $safetyAndPrivacyTableService): BinaryFileResponse
public function excelReport(Request $request, SupervisorService $supervisorService): BinaryFileResponse
{
$name = 'گزارش از نگهداری حریم راه ' . verta()->now()->format('Y-m-d H-i') . '.xlsx';
$data = $safetyAndPrivacyTableService->supervisorDataTable($request);
$data = $supervisorService->dataTable($request);
return Excel::download(new SupervisorCartableReport($data['data']), $name);
}