Configuration

The installer writes config/sidebar.php. You can also publish the default file:

php artisan vendor:publish --tag=sidebar-config
return [
    'cache' => [
        'method' => null,     // null, static or user-based
        'duration' => 1440,   // minutes
    ],

    'view' => 'AdminLTE2',    // AdminLTE2, AdminLTE3 or AdminLV

    'sidebar' => [
        'class' => null,      // e.g. App\Sidebars\AdminSidebar::class
        'view' => 'admin.partials._sidebar',
        'key' => 'sidebar',
    ],

    'middleware' => [
        'alias' => 'sidebar',
        'class' => Wikigods\Sidebar\Middleware\ResolveSidebars::class,
    ],

    'permissions' => [
        'driver' => 'spatie', // spatie, sentinel or none
        'resolver' => null,   // a class implementing PermissionResolver
    ],
];
Key Description
cache.method How the built menu is cached. See Caching.
cache.duration Cache lifetime in minutes.
view Built-in template. See Views and templates.
sidebar.class Sidebar registered automatically. It must implement Wikigods\Sidebar\Sidebar.
sidebar.view Blade view that receives the rendered sidebar. Leave it empty to render it yourself.
sidebar.key Variable name of the rendered sidebar in that view.
middleware.alias Route middleware alias registered by the package.
middleware.class Middleware behind the alias.
permissions.driver Driver used by authorizePermission(). See Permissions.
permissions.resolver Custom resolver class; it wins over driver.

Note

With sidebar.view set to admin.partials._sidebar and sidebar.key set to navigation, print the menu with {!! $navigation !!} in resources/views/admin/partials/_sidebar.blade.php.