Magento 2 – Custom Module Not Listing in Admin Panel

magento2module

after php bin/magento setup:upgrade module is not listed. where is my mistake?

File location are

app/code/Test/composer.json

{
    "name": "test/banners",
    "description": "Test Banner For test",
    "require": {
        "php": "~5.5.0|~5.6.0|~7.0.0",
        "magento/framework": "100.0.*"
    },
    "type": "magento2-module",
    "version": "1.0.0",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "autoload": {
        "files": [
            "registration.php"
        ],
        "psr-4": {
            "Test\\Banners\\": ""
        }
    }
}

app/code/Test/registration.php

  <?php
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Test_Banners',
    __DIR__
);

app/code/Test/Banners/etc/module.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Test_Banners" setup_version="2.0.0">

    </module>
</config>

Best Answer

In your edit I see that you're listing files (registration.php and composer.json) outside the module's directory. The correct path for these file should be:

app/code/Test/Banners/registration.php

app/code/Test/Banners/composer.json

app/code/Test/Banners/etc/module.xml

after making these changes run the php bin/magento setup:upgrade command

Related Topic