Update Migration Input Update Praktik Budidaya
This commit is contained in:
@@ -78,16 +78,21 @@ class Petani extends Model
|
||||
return $this->belongsTo(User::class, 'user_id');
|
||||
}
|
||||
|
||||
public function praktik_budidaya(): HasOne
|
||||
{
|
||||
return $this->hasOne(PraktikBudidaya::class, 'petani_id');
|
||||
}
|
||||
|
||||
public function praktikBudidaya(): HasOne
|
||||
{
|
||||
return $this->hasOne(PraktikBudidaya::class, 'petani_id')->latestOfMany();
|
||||
}
|
||||
|
||||
public function surveyPanen(): HasOne
|
||||
{
|
||||
return $this->hasOne(surveyPanen::class, 'petani_id')->latestOfMany();
|
||||
}
|
||||
|
||||
public function surveyProduktivitas(): HasOne
|
||||
{
|
||||
return $this->hasOne(surveyProduktivitas::class, 'petani_id')->latestOfMany();
|
||||
}
|
||||
|
||||
public function lahans(): HasMany
|
||||
{
|
||||
return $this->hasMany(Lahan::class, 'petani_id');
|
||||
|
||||
@@ -56,8 +56,17 @@ class PraktikBudidaya extends Model
|
||||
'kebutuan_air_permusim',
|
||||
'kebiasaan_konservasi_tanah',
|
||||
'pemahaman_manfaat_konservasi_tanah',
|
||||
// 'nilai_konservasi_tanah',
|
||||
// 'upah_tenaga_kerja'
|
||||
'upah_tenaga_kerja',
|
||||
'biaya_bibit',
|
||||
'biaya_pupuk',
|
||||
'biaya_obat_obatan',
|
||||
'biaya_sewa_alat',
|
||||
'biaya_penyediaan_air',
|
||||
'biaya_lainnya',
|
||||
'total_estimasi_biaya_produksi',
|
||||
'created_by',
|
||||
'updated_by',
|
||||
'deleted_by',
|
||||
];
|
||||
|
||||
public function petani(): BelongsTo
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Pertanian;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
use App\Models\Pertanian\Petani;
|
||||
|
||||
class SurveyPanen extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'survey_panen';
|
||||
|
||||
protected $fillable = [
|
||||
'uid',
|
||||
'petani_id',
|
||||
'dasar_penentuan_panen',
|
||||
'frekuensi_panen_pertahun',
|
||||
'bulan_panen_utama',
|
||||
'hasil_komoditas_utama_permusim',
|
||||
'hasil_komoditas_lainnya_permusim',
|
||||
'disimpan_untuk_sendiri',
|
||||
'hasil_panen_disimpan',
|
||||
'tujuan_disimpan',
|
||||
'praktik_sortasi',
|
||||
'bentuk_sortasi',
|
||||
'hasil_panen_reject',
|
||||
'jumlah_panen_reject',
|
||||
'tindakan_panen_reject',
|
||||
'upah_tenaga_panen',
|
||||
'biaya_pengangkutan_panen',
|
||||
'biaya_wadah_panen',
|
||||
'biaya_sewa_alat_panen',
|
||||
'biaya_panen_lainnya',
|
||||
'total_estimasi_biaya_panen',
|
||||
'estimasi_kehilangan_akibat_opt',
|
||||
'estimasi_kehilangan_akibat_hama_penyakit',
|
||||
'created_by',
|
||||
'updated_by',
|
||||
'deleted_by',
|
||||
];
|
||||
|
||||
public function petani(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Petani::class, 'petani_id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Pertanian;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class SurveyProduktivitas extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'survey_produktivitas';
|
||||
|
||||
protected $fillable = [
|
||||
'uid',
|
||||
'petani_id',
|
||||
'komoditas_id',
|
||||
'kuantitas',
|
||||
'satuan',
|
||||
'created_by',
|
||||
'updated_by',
|
||||
'deleted_by',
|
||||
];
|
||||
|
||||
public function petani(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Petani::class, 'petani_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user