'integer', 'sort_order' => 'integer', 'is_enabled' => 'boolean', ]; /* Optional relationships */ public function parent() { return $this->belongsTo(self::class, 'menu_parent_id'); } public function children() { return $this->hasMany(self::class, 'menu_parent_id'); } /** * Equivalent of CI getChildrenOf() * NOTE: CI code uses where('parent_id', ...) but allowedFields has menu_parent_id. * This Laravel version uses menu_parent_id (likely correct). */ public static function getChildrenOf(int $parentId): array { return static::query() ->where('menu_parent_id', $parentId) ->where('is_enabled', 1) ->orderBy('sort_order', 'asc') ->get() ->toArray(); } }