tomatophp / filament-menus
Menu View Generator Using View Component
Fund package maintenance!
3x1io
Requires
- php: ^8.1|^8.2
- filament/filament: ^3.0.0
- filament/notifications: ^3.0.0
- tomatophp/console-helpers: ^1.1
This package is auto-updated.
Last update: 2024-04-16 12:29:06 UTC
README
Filament Menus
Menu View Generator Using View Component
Installation
composer require tomatophp/filament-menus
after install your package please run this command
php artisan filament-menus:install
finally register the plugin on /app/Providers/Filament/AdminPanelProvider.php
->plugin(\TomatoPHP\FilamentMenus\FilamentMenusPlugin::make())
Usage
go to route admin/menus
and create a new menu and you will get the code of livewire component
you can build a menu just by using this command as a livewire component
<x-filament-menu menu="header" />
where header
is a key of menu and you will get the code ready on the Table list of menus
you can use custom view ex:
<x-filament-menu menu="header" view="menu-item" />
by default we use Tailwind as a main view with this code
@foreach ($menuItems as $item) <a class="text-gray-500" href="{{ $item['url'] }}" @if($item['blank']) target="_blank" @endif> <span class="flex justify-between"> @if(isset($item['icon']) && !empty($item['icon'])) <x-icon class="w-4 h-4 mx-2" name="{{ $item['icon'] }}"></x-icon> @endif {{ $item['title'] }} </span> </a> @endforeach
or you can use direct helper menu($key)
to get the menu items
@foreach (menu('header') as $item) <a class="text-gray-500" href="{{ $item['url'] }}" @if($item['blank']) target="_blank" @endif> <span class="flex justify-between"> @if(isset($item['icon']) && !empty($item['icon'])) <x-icon class="w-4 h-4 mx-2" name="{{ $item['icon'] }}"></x-icon> @endif {{ $item['title'] }} </span> </a> @endforeach
Publish Assets
you can publish config file by use this command
php artisan vendor:publish --tag="filament-menus-config"
you can publish views file by use this command
php artisan vendor:publish --tag="filament-menus-views"
you can publish languages file by use this command
php artisan vendor:publish --tag="filament-menus-lang"
you can publish migrations file by use this command
php artisan vendor:publish --tag="filament-menus-migrations"
Support
you can join our discord server to get support TomatoPHP
Docs
you can check docs of this package on Docs
Changelog
Please see CHANGELOG for more information on what has changed recently.
Security
Please see SECURITY for more information about security.
Credits
License
The MIT License (MIT). Please see License File for more information.