add group by feature to datatable

This commit is contained in:
2025-04-15 10:45:47 +03:30
parent 6f896f4894
commit 8d138b8339
6 changed files with 91 additions and 129 deletions

View File

@@ -24,16 +24,23 @@ use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Facades\Validator;
use Maatwebsite\Excel\Facades\Excel;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
use Throwable;
class SafetyAndPrivacyController extends Controller
{
use ApiResponse;
/**
* @throws Throwable
*/
public function index(Request $request, SafetyAndPrivacyTableService $safetyAndPrivacyTableService): JsonResponse
{
return response()->json($safetyAndPrivacyTableService->datatable($request));
}
/**
* @throws Throwable
*/
public function excelReport(Request $request, SafetyAndPrivacyTableService $safetyAndPrivacyTableService): BinaryFileResponse
{
$name = 'گزارش از نگهداری حریم راه ' . verta()->now()->format('Y-m-d H-i') . '.xlsx';