38 lines
821 B
PHP
38 lines
821 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\Program\Transformasi;
|
|
use App\Models\Program\Target;
|
|
|
|
class Aktivitas extends Model
|
|
{
|
|
use SoftDeletes;
|
|
|
|
protected $table = 'program_aktivitas';
|
|
|
|
protected $fillable = [
|
|
"kode",
|
|
"nama",
|
|
"jenis_aktivitas",
|
|
"indikator",
|
|
"deskripsi",
|
|
"transformasi_id",
|
|
];
|
|
|
|
public function transformasi(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Transformasi::class, 'transformasi_id', 'id');
|
|
}
|
|
|
|
public function target(): HasMany
|
|
{
|
|
return $this->hasMany(Target::class, 'aktivitas_id', 'id');
|
|
}
|
|
}
|