New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

typicms/sidebar

A sidebar builder for TypiCMS
4,163
Install
composer require typicms/sidebar
Latest Version:2.0.0
PHP:^8.2
Laravel:12 · 13
License:MIT
Last Updated:May 1, 2026
Links: GitHub  ·  Packagist
Maintainer: Samuel De Backer

TypiCMS Sidebar

This package is based on SpartnerNL/Laravel-Sidebar v1

Installation

Require this package in your composer.json and run composer update.

"typicms/sidebar": "~1.0.0"

After updating composer, add the ServiceProvider to the providers array in bootstrap/providers.php

'TypiCMS\Modules\Sidebar\SidebarServiceProvider::class',

To publish the default views use:

php artisan vendor:publish

Adding a menu

// Or use dependency injection
$builder = app('TypiCMS\Modules\Sidebar\SidebarManager');

$builder->group('app', function ($group)
{
    $group->addItem('dashboard', function($item)
    {
        // Route method automatically transforms it into a route
        $item->route('admin::dashboard');

        // If you want to call route() yourself to pass optional parameters
        $item->route = route('admin::dashboard');
    });
}

Groups

It’s possible to group the menu items. A little header will be rendered to separate the different menu items.

Adding items

The first parameter of $group->addItem() is the name. The name field will automatically be translated through the menu translation file. (e.g. menu.dashboard). If the translation does not exists, the given name will be displayed.

The second parameter is optionally a callback. Alternatively you can chain the methods.

You can change the route, name and icon. If you route given it will automatically be translated to acp.{$name}.index.

Without group headings

To disable rendering of the group headings, you can easily use $builder->withoutGroup(). Group headings will now be ignored.

Authorization

By default, all groups and items are public for all users. You can use ->authorized(false) on all these objects to disable them or use any condition you want.

Advanced usage

If you have multiple sidebars, you can extend the SidebarManager and register a new singleton:

class AdminSidebar extends SidebarManager
{
    public function build($callback = null)
    {
        $this->group('application', function(SidebarGroup $group) {

            $group->addItem(...)

        });
    }

}

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

648,266,899 9,701
laravel/framework

The Laravel Framework.

604,216,237 34,982
laravel/tinker

Powerful REPL for the Laravel framework.

512,508,631 7,443
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

429,221,767 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

407,699,310 4,663

Version History

Version Released PHP Laravel License
2.0.0 ^8.2 >=12.0 MIT
1.2.0 ^8.2 >=12.0 MIT
1.1.1 ^8.2 >=12.0 MIT
1.1.0 ^8.2 >=12.0 MIT
1.0.1 ^8.2 >=12.0 MIT