petani lahan dan skor
This commit is contained in:
@@ -100,8 +100,9 @@ class PetaniController extends Controller
|
||||
$validatedData['foto'] = $file_foto->store('petani/foto');
|
||||
}
|
||||
|
||||
Petani::create([...$validatedData,
|
||||
'uid' => 'PTN-'. strtoupper(Str::random(10)),
|
||||
$petaniUID = strtoupper(Str::random(10));
|
||||
$petani = Petani::create([...$validatedData,
|
||||
'uid' => 'PTN-'. $petaniUID,
|
||||
'created_by' => auth()->id(),
|
||||
'updated_by' => auth()->id()]);
|
||||
|
||||
|
||||
@@ -94,6 +94,10 @@ class PetaniLahanController extends Controller
|
||||
'serangan_hama' => ['nullable', 'string', new Enum(SeranganHama::class)],
|
||||
'penyakit_tanaman' => ['nullable', 'string', new Enum(PenyakitTanaman::class)],
|
||||
'keparahan_serangan' => ['nullable', 'string', new Enum(KeparahanSerangan::class)],
|
||||
'komoditas_lain' => ['nullable', 'array'],
|
||||
'komoditas_lain.*' => ['integer', 'exists:master_komoditas,id'],
|
||||
'tanaman_penaung' => ['nullable', 'array'],
|
||||
'tanaman_penaung.*' => ['integer', 'exists:master_komoditas,id'],
|
||||
]);
|
||||
|
||||
$komoditas = Komoditas::where('id', $request->komoditas_id)->first();
|
||||
@@ -167,6 +171,7 @@ class PetaniLahanController extends Controller
|
||||
$lahan = Lahan::where('petani_id', $petaniId)
|
||||
->orderBy('id', 'asc')
|
||||
->get();
|
||||
|
||||
|
||||
$lahanSelected = Lahan::where('petani_id', $petaniId)->findOrFail($id);
|
||||
|
||||
@@ -206,6 +211,10 @@ class PetaniLahanController extends Controller
|
||||
'serangan_hama' => ['nullable', 'string', new Enum(SeranganHama::class)],
|
||||
'penyakit_tanaman' => ['nullable', 'string', new Enum(PenyakitTanaman::class)],
|
||||
'keparahan_serangan' => ['nullable', 'string', new Enum(KeparahanSerangan::class)],
|
||||
'komoditas_lain' => ['nullable', 'array'],
|
||||
'komoditas_lain.*' => ['integer', 'exists:master_komoditas,id'],
|
||||
'tanaman_penaung' => ['nullable', 'array'],
|
||||
'tanaman_penaung.*' => ['integer', 'exists:master_komoditas,id'],
|
||||
]);
|
||||
|
||||
$komoditas = Komoditas::where('id', $request->komoditas_id)->first();
|
||||
|
||||
Reference in New Issue
Block a user