-
Notifications
You must be signed in to change notification settings - Fork 58
Upgrade guide
Nicolas Widart edited this page Jun 21, 2015
·
8 revisions
- The purpose of the
SidebarManager
is changed. The manager is now only responsible for registering the Sidebar, not for building. - Instead of directly building the menu in
$manager->build()
, you will have to create a new class which implementsMaatwebsite\Sidebar\Sidebar
. Register this custom Sidebar with the manager:$manager->register(YourSidebar::class);
(See full example in Wiki) - To render your Sidebar (in a view creator for example) you will have to inject your custom Sidebar class and
Maatwebsite\Sidebar\Presentation\SidebarRenderer
and render like$this->renderer->render($this->sidebar)
(See full example in Wiki) - It's no longer possible to use multiple view composers to fill the sidebar, due to caching implementation. Instead create a new class that extends
Maatwebsite\Sidebar\SidebarExtender
and add it to your Sidebar. (See full example in Wiki) - To resolve the sidebars you need to add
'Maatwebsite\Sidebar\Middleware\ResolveSidebars'
to your middlewares inApp\Http\Kernel
-
addItem()
->item()
- Magic getters and setters are removed.
$group->weight = 0
->$group->weight(0)
; -
$badge->color = ''
->$badge->setClass()
; -
$badge->value = ''
->$badge->setValue()
; - Class
SidebarGroup
-> interfaceGroup
- Class
SidebarItem
-> interfaceItem
- Class
SidebarBadge
-> interfaceBadge
- Class
SidebarAppend
-> interfaceAppend