Skip to content

Upgrade guide

Patrick Brouwers edited this page Jun 21, 2015 · 8 revisions

Upgrade 1.0 -> 2.0

Architectural changes

  • 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 implements Maatwebsite\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)

Syntax changes