PHP code example of plokko / menu-builder
1. Go to this page and download the library: Download plokko/menu-builder 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/ */
plokko / menu-builder example snippets
plokko\MenuBuilder\MenuBuilderServiceProvider::class,
plokko\MenuBuilder\Facades\Menu::class,
$menu = Menu::useTrans('menu.main')
->item('home')->route('home')->icon('home')
->item('clients')->route('clients.index')->icon('business')
->item('curtain-models')->route('curtain-models.index')->icon('blinds')
->whenHasRole('admin', fn($m) =>
$m->item('users')->route('users.index')->icon('account_circle')->color('pink')
);
$menuArray = $menu->toArray();