1. Go to this page and download the library: Download milpa/admin library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Milpa\Admin\Section\{AdminSection, AdminSectionProvider};
final class InventoryPlugin implements PluginInterface, AdminSectionProvider
{
public function adminSections(): array
{
return [
// a dashboard primitive the panel already knows, with props
new AdminSection(id: 'stock', title: 'Stock', component: 'metric-card',
props: ['title' => 'Units in stock', 'value' => '1,204'], order: 30),
// or a component you bring yourself — definition + renderer, registered under `component`
new AdminSection(id: 'inventory', title: 'Inventory', component: 'inventory-table',
definition: new InventoryComponent($repo), renderer: new InventoryRenderer(), order: 31),
];
}
}