<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Menu extends Model
{
    protected $table = 'menus';

    protected $fillable = [
        'parent_id', 'titulo', 'tab_key', 'icono', 'tipo', 'contenido', 'orden', 'activo',
    ];

    public function padre()
    {
        return $this->belongsTo(Menu::class, 'parent_id');
    }

    public function hijos()
    {
        return $this->hasMany(Menu::class, 'parent_id');
    }
}
