tanaman validate
This commit is contained in:
@@ -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)],
|
||||
|
||||
Reference in New Issue
Block a user