Magento 2- Create Menu in admin panel

Magento 2: Create Menu in admin panel

Step 1: Create menu.xml file-

Path– app\code\Vendor\Modulename\etc\adminhtml\


<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Backend/etc/menu.xsd">
<menu>

<!-- parent -->
<add id="demo::base"

title="Demo"

module="Vendor_Namespace"

sortOrder="90"

resource="Vendor_Namespace::sample"/>

<!-- children -->
<add id="sample_demo::demo"

title="Demo Item 1"

module="Vendor_Namespace"

sortOrder="10"

parent="demo::base" //enter id of parent

action="vendor_namespace/items/"

resource="Vendor_Namespace::items"/>
</menu>
</config>