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, ]);