<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class WorkflowEtapa extends Model
{
    protected $table = 'workflow_etapas';

    protected $fillable = ['nombre', 'slug', 'orden', 'activo'];

    protected $casts = [
        'activo' => 'boolean',
        'orden' => 'integer',
    ];

    public function scopeActivas($query)
    {
        return $query->where('activo', true)->orderBy('orden');
    }
}
