<?php

namespace App\Models\Admin;

use App\Traits\HasSortsTrait;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasMany;

class Modulos extends Model
{
    use HasFactory, HasSortsTrait, HasSortsTrait;

    protected $table = 'grupos_internas';

    protected $fillable = [
        'titulo',
        'slug',
        'icono'
    ];

    public function setTituloAttribute($value)
    {
        $this->attributes['titulo'] = ucfirst(trim($value));
        $this->attributes['slug'] =  str_slug(trim($value));
    }
}
