query('per_page', 10); $search = strtolower($request->query('search', '')); $tabel = TabelBasisData::with('kolom') ->whereHas('kolom', function ($query) { $query->where('is_active', true); }) ->whereRaw('lower(tabel) LIKE ?', ["%$search%"]) ->paginate($perPage); return TabelBasisDataResource::collection($tabel); } /** * Store a newly created resource in storage. */ public function store(Request $request) { // } /** * Display the specified resource. */ public function show(Request $request, string $id): JsonResponse { if (!Gate::any(['super_admin', 'admin', 'fasilitator'])) { abort(403); } $tabel = TabelBasisData::with('kolom', 'form', 'form.form', 'form.form.form', 'form.form.form.kolom')->findOrFail($id); return (new TabelBasisDataResource($tabel)) ->response(); } /** * Update the specified resource in storage. */ public function update(Request $request, string $id) { // } /** * Remove the specified resource from storage. */ public function destroy(string $id) { // } }