<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class LmsCourseCompetency extends Model
{
    protected $table = 'lms_course_competencies';

    protected $fillable = [
        'course_id',
        'competency',
        'description',
        'sub_competencies',
        'order',
    ];

    protected $casts = [
        'order' => 'integer',
        'sub_competencies' => 'array',
    ];

    // Relationships
    public function course(): BelongsTo
    {
        return $this->belongsTo(LmsCourse::class, 'course_id');
    }
}
