Magento 2
Create a module skeleton
Free Preview
app/code/Foo/Bar/etc/module.xml
<?xml version="1.0"?>
<!--
The "urn:magento:framework:Module/etc/module.xsd" schema is used to validate the
format of this XML file. You can view and inspect this file at:
vendor/magento/framework/Module/etc/module.xsd
-->
<config
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <!--
    The module node's "name" attribute defines the module in Title_Snake syntax.
    In this example, "Foo" is the vendor name and "Bar" is the module name.
    -->
   <module name="Foo_Bar"/>
</config>
app/code/Foo/Bar/registration.php
<?php declare(strict_types=1);

// Import the ComponentRegistrar class at the top of the file...
use Magento\Framework\Component\ComponentRegistrar;

// ...then call its register() function to register the module with Magento.
ComponentRegistrar::register(
    ComponentRegistar::MODULE, // Type of module
      'Foo_Bar', // Name of the module in Title_Snake syntax
    __DIR__ // Directory the module is located in (__DIR__ is current directory)
);
Want to learn more?

Visit M.academy to learn much more about Magento, Laravel, PHP, Javascript, & Docker.

M.academy logo