change export for safty proivecy

This commit is contained in:
2025-08-31 11:28:13 +03:30
parent 761e2b77da
commit 78706ac766
17 changed files with 482 additions and 712 deletions

View File

@@ -12,6 +12,7 @@ use App\Services\Cartables\SafetyAndPrivacy\OperatorService;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Maatwebsite\Excel\Facades\Excel;
use PhpOffice\PhpSpreadsheet\Exception;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
class ConstructionActivityController extends Controller
@@ -38,6 +39,11 @@ class ConstructionActivityController extends Controller
'edarateShahri' => EdarateShahri::where('province_id', $request->province_id)->get(['id', 'name_fa']),
]);
}
/**
* @throws Exception
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
*/
public function countryExcelActivity(Request $request, OperatorService $operatorService): BinaryFileResponse
{
$data = $operatorService->countryActivity(89);
@@ -46,6 +52,10 @@ class ConstructionActivityController extends Controller
return Excel::download(new ExcelReport($data), $name);
}
/**
* @throws Exception
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
*/
public function provinceExcelActivity(Request $request, OperatorService $operatorService): BinaryFileResponse
{
$data = $operatorService->provinceActivity(