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\Menu
Facade, which pointed to a singleton instance of the menuRepository
class. - The
\Menu
class which is a Laravel alias, and it pointed to theMenu
Facade. - The
Konekt\Menu\Menu
class which represents a single menu.
With v2, this has been changed to:
- The facade is now
Menus
(within the same namespace) - The
\Menu
alias 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\Menu
has not changed.