PHP code example of ak-media / filament-menu-manager
1. Go to this page and download the library: Download ak-media/filament-menu-manager 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/ */
ak-media / filament-menu-manager example snippets
use NoteBrainsLab\FilamentMenuManager\FilamentMenuManagerPlugin;
public function panel(Panel $panel): Panel
{
return $panel
->plugin(
FilamentMenuManagerPlugin::make()
->locations([
'primary' => 'Primary',
'footer' => 'Footer',
])
);
}
use NoteBrainsLab\FilamentMenuManager\Concerns\HasMenuItems;
class Post extends Model
{
use HasMenuItems;
// Optional: override the defaults
public function getMenuLabel(): string { return $this->title; }
public function getMenuUrl(): string { return route('posts.show', $this); }
public function getMenuTarget(): string { return '_self'; }
public function getMenuIcon(): ?string { return 'heroicon-o-document'; }
}