convert profile id

This commit is contained in:
2026-05-25 15:34:47 +07:00
parent 6341199fd5
commit b08df8f6fa
@@ -87,6 +87,9 @@ class LahanController extends Controller
if (!$profile) { if (!$profile) {
abort(404, 'Profile tidak ditemukan'); 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']; $profileRule = $user->role === 'fasilitator' ? ['required', 'numeric', 'exists:profiles,id'] : ['nullable'];
@@ -97,6 +100,7 @@ class LahanController extends Controller
'path' => ['nullable', 'array'], 'path' => ['nullable', 'array'],
'path.*' => ['array'], 'path.*' => ['array'],
'luas_lahan' => ['nullable', 'numeric'], 'luas_lahan' => ['nullable', 'numeric'],
'uid' => ['required', 'string'],
'profile_id' => $profileRule, 'profile_id' => $profileRule,
]); ]);