<?php

namespace App\Models;

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

class Menu extends Model
{
    use HasFactory;
    protected $table = 'tbl_menu';
    protected $fillable = [];

    public $timestamps = false;

    protected $primaryKey = 'id';

    public function children()
    {
        return $this->hasMany(Menu::class, 'parent_id', 'id')
            ->where('status', 1)
            ->orderBy('sort_order');
    }
}
