-
Notifications
You must be signed in to change notification settings - Fork 240
Updating new sidebar extender
In platform 1.0.3
, a big change was implemented, the way the sidebars are handled. Laravel-sidebar has been tagged 2.0
, the version introducing these new improvements.
Please read the Upgrade Guide carefully.
There is no more need for a SidebarViewComposer
, instead create a Sidebar/SidebarExtender.php
file, copy over the contents of your old SidebarViewComposer@compose
to extendWith
method on the SidebarExtender
class.
Change the following type hints:
-
SidebarGroup
=>Maatwebsite\Sidebar\Group
-
SidebarItem
=>Maatwebsite\Sidebar\Item
In app/Http/Kernel.php
add the following middleware 'Maatwebsite\Sidebar\Middleware\ResolveSidebars',
after ShareErrorsFromSession
, in the protected $middleware
property.
Delete the published views for the Sidebar package, located at resources/views/vendor/sidebar
. Then publish the views again, php artisan vendor:publish
.
Next, open resources/views/vendor/sidebar/group.php
, and rename the css class menu-title
to header
.
If you were extending this composer, you have to remove the extends
and inject the Authentication contract on your view composer.
- Changes
- Common errors
- Frequently Asked Questions