39 lines
859 B
PHP
39 lines
859 B
PHP
<?php
|
|
|
|
namespace App\Models\Program;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
use App\Models\Core\Program;
|
|
use App\Models\Program\Transformasi;
|
|
|
|
class Framework extends Model
|
|
{
|
|
use SoftDeletes;
|
|
|
|
protected $table = 'program_framework';
|
|
|
|
protected $fillable = [
|
|
"nama",
|
|
"tahun",
|
|
"program_id",
|
|
"created_by",
|
|
"updated_by",
|
|
];
|
|
|
|
public function program(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Program::class, 'program_id', 'id');
|
|
}
|
|
|
|
public function transformasi(): HasMany
|
|
{
|
|
return $this->hasMany(Transformasi::class, 'framework_id', 'id')
|
|
->orderBy('kode', 'asc')
|
|
->orderBy('id', 'asc');
|
|
}
|
|
}
|