<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Spatie\Activitylog\Traits\LogsActivity;
use Spatie\Activitylog\LogOptions;

class Program extends Model
{
    use LogsActivity;

    protected $fillable = [
        'main_title',
        'main_code',
        'background_image',
        'description',
        'button_text',
        'button_link',
        'button_color',
        'button_background_color',
        'level_contain',
        'curriculum_title',
        'job_title',
        'job_contain',
        'program_members',
    ];

    protected $casts = [
        'level_contain' => 'array',
        'job_contain' => 'array',
        'program_members' => 'array',
    ];
    public function semesters()
    {
        return $this->hasMany(Semester::class);
    }

    public function facilitymembers()
    {
        return $this->hasMany(Facilitymember::class);
    }

    public function getActivitylogOptions(): \Spatie\Activitylog\LogOptions
    {
        return \Spatie\Activitylog\LogOptions::defaults()->logAll();
    }
}
