<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Estadistica extends Model
{
    protected $fillable = ['etiqueta', 'valor', 'sufijo', 'icono', 'color', 'orden', 'activo'];
    protected $casts = ['activo' => 'boolean', 'valor' => 'integer'];

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