Skip to content

Magewire in Magento Admin

Build an admin component with the same PHP class, PHTML template, and layout argument used on the storefront. Install magewirephp/magewire-admin to add the admin update route and browser integration:

composer require magewirephp/magewire-admin
bin/magento module:enable Magewirephp_MagewireAdmin
bin/magento setup:upgrade

Then put the layout and template in view/adminhtml/:

Vendor/Module/
├── Magewire/Admin/ReportFilter.php
└── view/adminhtml/
    ├── layout/vendor_module_report_index.xml
    └── templates/magewire/admin/report-filter.phtml

The binding still uses a direct magewire object argument:

<block name="vendor.module.report-filter"
       template="Vendor_Module::magewire/admin/report-filter.phtml">
    <arguments>
        <argument name="magewire" xsi:type="object" shared="false">
            Vendor\Module\Magewire\Admin\ReportFilter
        </argument>
    </arguments>
</block>

Choose the layout handle and parent container for the admin page you are extending. Building admin components shows a larger example with an action and ACL check.

Admin authentication protects the update route, but it does not decide which records a given admin user may change. Check the appropriate ACL resource inside every sensitive action and let a Magento service enforce the operation's business rules. The admin theme also has different CSS and JavaScript conventions from Hyvä; do not assume Tailwind classes or storefront script ordering are available.

See Installation for verification, How it works for routing and script details, and Admin rate limiting for update traffic controls.