<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Committee extends Model
{
    protected $fillable = [
        'name', 'position', 'institution', 'photo', 'type', 'order', 'is_active'
    ];

    protected $casts = [
        'is_active' => 'boolean',
    ];

    public function scopeActive($query)
    {
        return $query->where('is_active', true);
    }

    public function scopeSteering($query)
    {
        return $query->where('type', 'steering');
    }

    public function scopeOrganizing($query)
    {
        return $query->where('type', 'organizing');
    }

    public function scopeScientific($query)
    {
        return $query->where('type', 'scientific');
    }
}
