PHP code example of coddin-web / filament-menu-generator

1. Go to this page and download the library: Download coddin-web/filament-menu-generator 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/ */

    

coddin-web / filament-menu-generator example snippets


use CoddinWeb\FilamentMenuGenerator\Navigation;

final class AdminNavigation extends Navigation
{
    #[\Override]
    public static function getMenu(): array
    {
        return [
            CustomerResource::class => [
                'group' => 'Management'
            ],
            InvoiceResource::class => [
                'group' => 'Management'
            ],
            
            UserResource::class => [
                'group' => 'Administration'
            ],
        ];
    }
}

// ... \App\Filament\Admin\Resources\CustomerResource.php

public static function getNavigationGroup(): string
{
    return AdminNavigation::group(self::class);
}

public static function getNavigationSort(): int
{
    return AdminNavigation::sort(self::class);
}