<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Skill extends Model
{
    use HasFactory;

    protected $fillable = [
        'name',
        'description',
        'code',
        'category',
        'max_score',
        'weight',
    ];

    protected $casts = [
        'max_score' => 'float',
        'weight' => 'float',
    ];

    public function knowledgePoints()
    {
        return $this->belongsToMany(KnowledgePoint::class, 'knowledge_point_skill');
    }
}