Merge branch 'main' of https://git.probindo.com/Probindo/database-pertani-web
This commit is contained in:
@@ -36,4 +36,9 @@ class Tanaman extends Model
|
||||
return $this->belongsTo(Komoditas::class, 'komoditas_id');
|
||||
}
|
||||
|
||||
public function panen()
|
||||
{
|
||||
return $this->hasMany(\App\Models\Map\Panen::class, 'plant_id');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use App\Models\Wilayah\DesaKelurahan;
|
||||
use App\Models\Pertanian\Tanaman;
|
||||
use App\Models\Profile;
|
||||
use App\Models\Pertanian\Adat;
|
||||
use App\Enums\StatusLahan;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
@@ -46,6 +47,11 @@ class Lahan extends Model
|
||||
return $this->belongsTo(DesaKelurahan::class, 'desa_kelurahan_id');
|
||||
}
|
||||
|
||||
public function adat(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Adat::class, 'adat_pemilik_id');
|
||||
}
|
||||
|
||||
public function tanaman(): HasMany
|
||||
{
|
||||
return $this->hasMany(Tanaman::class, 'lahan_id');
|
||||
|
||||
Reference in New Issue
Block a user