35 lines
706 B
PHP
35 lines
706 B
PHP
<?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');
|
|
}
|
|
}
|