Penambahan Form Varietas
This commit is contained in:
@@ -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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user