<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class Menu extends Model
{
    use HasFactory;

    public function submenu()
    {
        return $this->hasMany('App\Models\Menuitems')->with('childs')
            ->doesntHave('parent')
            ->orderBY('order','asc');
    }
}
