<?php

namespace App\Models;

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

class Extracuricullar extends Model
{
    protected $fillable = ['nama','kategori','deskripsi'];

    public $timestamps = false;

    protected static $rules = ['kategori' => 'Olahraga, Seni'];

    public static function getValidCategories()
    {
        $rule = static::$rules['kategori'];
        return explode(', ', $rule);
    }

    public function ExtracuricullarSubCriteria() {
        return $this->hasMany(ExtracuricullarSubKriteria::class);
    }
}
