Merge branch 'main' of https://git.probindo.com/Probindo/database-pertani-web
This commit is contained in:
@@ -20,6 +20,7 @@ class Program extends Model
|
||||
"sub_domain",
|
||||
"tahun",
|
||||
"instansi",
|
||||
"nama_singkat",
|
||||
];
|
||||
|
||||
public function komoditas(): HasMany
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Master;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use App\Models\Pertanian\Komoditas;
|
||||
|
||||
class JenisKomoditas extends Model
|
||||
{
|
||||
use HasFactory, SoftDeletes;
|
||||
|
||||
protected $table = 'jenis_komoditas';
|
||||
|
||||
protected $fillable = [
|
||||
'nama',
|
||||
'komoditas_id',
|
||||
'created_by',
|
||||
'updated_by',
|
||||
'deleted_by',
|
||||
];
|
||||
|
||||
public function komoditas()
|
||||
{
|
||||
return $this->belongsTo(Komoditas::class, 'komoditas_id');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Master;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use App\Models\Pertanian\Komoditas;
|
||||
use App\Models\Master\JenisKomoditas;
|
||||
|
||||
class Varietas extends Model
|
||||
{
|
||||
protected $table = 'master_varietas';
|
||||
|
||||
protected $fillable = [
|
||||
'komoditas_id',
|
||||
'jenis_komoditas_id',
|
||||
'nama',
|
||||
'deskripsi',
|
||||
'created_by',
|
||||
'updated_by',
|
||||
];
|
||||
|
||||
public function jenisKomoditas()
|
||||
{
|
||||
return $this->belongsTo(JenisKomoditas::class, 'jenis_komoditas_id');
|
||||
}
|
||||
|
||||
public function komoditas()
|
||||
{
|
||||
return $this->belongsTo(Komoditas::class, 'komoditas_id');
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\wilayah;
|
||||
namespace App\Models\Wilayah;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
Reference in New Issue
Block a user