From b08df8f6fae2cd2383715408160354114a5bc18b Mon Sep 17 00:00:00 2001 From: "fauzgabriel@gmail.com" Date: Mon, 25 May 2026 15:34:47 +0700 Subject: [PATCH] convert profile id --- app/Http/Controllers/Api/LahanController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Http/Controllers/Api/LahanController.php b/app/Http/Controllers/Api/LahanController.php index b312bd8..5b48ed3 100644 --- a/app/Http/Controllers/Api/LahanController.php +++ b/app/Http/Controllers/Api/LahanController.php @@ -87,7 +87,10 @@ class LahanController extends Controller if (!$profile) { abort(404, 'Profile tidak ditemukan'); } - + if ($request->has('profile_id')) { + $request->merge(['profile_id' => (int) $request->profile_id]); + } + $profileRule = $user->role === 'fasilitator' ? ['required', 'numeric', 'exists:profiles,id'] : ['nullable']; $validated = $request->validate([ @@ -97,6 +100,7 @@ class LahanController extends Controller 'path' => ['nullable', 'array'], 'path.*' => ['array'], 'luas_lahan' => ['nullable', 'numeric'], + 'uid' => ['required', 'string'], 'profile_id' => $profileRule, ]);