From f8304f8f843a0db9ec861cb758284ebbc3ffbe67 Mon Sep 17 00:00:00 2001 From: "fauzgabriel@gmail.com" Date: Thu, 18 Jun 2026 13:33:37 +0700 Subject: [PATCH] tanaman validate --- app/Http/Controllers/Api/TanamanController.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/app/Http/Controllers/Api/TanamanController.php b/app/Http/Controllers/Api/TanamanController.php index 683d162..e85ca87 100644 --- a/app/Http/Controllers/Api/TanamanController.php +++ b/app/Http/Controllers/Api/TanamanController.php @@ -108,13 +108,14 @@ class TanamanController extends Controller $validated = $request->validate([ 'nama' => ['required', 'string', 'max:255'], 'komoditas_id' => ['required', 'exists:master_komoditas,id'], - 'lahan_id' => [ - 'required', - Rule::exists('map_lahan', 'id')->where(function ($query) use ($profileId) { - $query->where('profile_id', $profileId) - ->whereNull('deleted_at'); - }), - ], + 'lahan_id' => ['required', 'exists:map_lahan'], + // [ + // 'required', + // Rule::exists('map_lahan', 'id')->where(function ($query) use ($profileId) { + // $query->where('profile_id', $profileId) + // ->whereNull('deleted_at'); + // }), + // ], 'latitude' => ['nullable', 'numeric', 'between:-90,90', 'required_with:longitude'], 'longitude' => ['nullable ', 'numeric', 'between:-180,180', 'required_with:latitude'], 'kondisi_tanaman' => ['nullable', 'string', new Enum(KondisiTanaman::class)],