Upgrade
1.x -> 2.x
The 2.0 version is a major rework of the initial 1.x series of the library. It comes with many interface and feature changes, adds parameter and return types, and abandons magic methods and properties in favour of an explicit API.
Facade Renamed
The Menu facade has been renamed to Menus in order to avoid ambiguity with the Menu (single menu instance) class.
use Konekt\Menu\Facades\Menu; // <- v1.x
use Konekt\Menu\Facades\Menus; // <- v2.x
Why?
The Menus facade points to the Menu repository, and it can be used to create and retrieve menus.
Additionally, v1.x contained three different Menu classes:
- The
Konekt\Menu\Facades\MenuFacade, which pointed to a singleton instance of the menuRepositoryclass. - The
\Menuclass which is a Laravel alias, and it pointed to theMenuFacade. - The
Konekt\Menu\Menuclass which represents a single menu.
With v2, this has been changed to:
- The facade is now
Menus(within the same namespace) - The
\Menualias is kept for compatibility, but in views now you should use themenu()helper instead:menu('topmenu')which is equivalent to\Menu::get('topmenu') - The
Konekt\Menu\Menuhas not changed.