- Install
wotz/filament-menuinstead ofcodedor/filament-menu - Replace all occurrences of
Codedor\FilamentMenunamespace with newWotz\FilamentMenunamespace
This major release introduces a completely refactored menu system with a more flexible and extensible architecture. The main change is the introduction of Navigation Elements - a new way to handle different types of menu items that allows for better customization and future extensibility.
The menu items table structure has been completely redesigned:
- Removed columns:
link,label,translated_link,online - Added columns:
type(string),data(JSON)
All menu item data is now stored in a flexible JSON structure, allowing for different types of menu items with varying data requirements.
The MenuItem model has been significantly simplified:
- Removed
HasTranslationsandHasOnlineScopetraits - Removed translatable properties
- Added
typeattribute that maps to navigation element classes - All item-specific data is now stored in the
dataJSON column
-
Run the migration: The package includes an automatic migration that will:
- Add the new
typeanddatacolumns - Migrate all existing menu items to the new structure
- Remove the old columns
- Add the new
-
Update custom views: If you have custom menu rendering views, update them to use the new structure:
// Old way {{ $item->label }} {{ $item->route }} // New way {{ (new $item->type)->render($item) }}
-
Update any custom code: If you interact with menu items programmatically, update to use the new data structure:
// Old way $menuItem->label; $menuItem->getTranslation('online', 'en'); // New way $menuItem->data['en']['label']; $menuItem->data['en']['online'];
Menu item data is now stored as:
{
"link": "main-link-value",
"en": {
"label": "English Label",
"online": true,
"translated_link": "optional-english-specific-link"
},
"nl": {
"label": "Dutch Label",
"online": false,
"translated_link": null
}
}- Backup your database before upgrading
- Run
composer update wotz/filament-menu - Run
php artisan migrate - Clear caches:
php artisan cache:clear - Check the blade components in your project, they have to be updated to use the new navigation element system
- Test your menus in both the admin panel and front-end
If you encounter issues during the upgrade:
- Migration fails: Check that you have a backup and that no custom code is interfering with the migration
- Menu items not displaying: Verify that your custom views have been updated to use the new navigation element system
- Missing data: The migration should preserve all existing data, but check the
datacolumn in themenu_itemstable to ensure everything migrated correctly
For additional support, please open an issue on GitHub.