program dan basis data ekosistem
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Core;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
use App\Models\Core\KomoditasProgram;
|
||||
use App\Models\Core\LokasiProgram;
|
||||
|
||||
class Program extends Model
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
protected $table = 'core_program';
|
||||
|
||||
protected $fillable = [
|
||||
"nama",
|
||||
"sub_domain",
|
||||
"tahun",
|
||||
"instansi",
|
||||
];
|
||||
|
||||
public function komoditas(): HasMany
|
||||
{
|
||||
return $this->hasMany(KomoditasProgram::class, 'program_id', 'id');
|
||||
}
|
||||
|
||||
public function lokasi(): HasMany
|
||||
{
|
||||
return $this->hasMany(LokasiProgram::class, 'program_id', 'id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user