PHPackages                             tasmir/sidebar-manager - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. tasmir/sidebar-manager

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

tasmir/sidebar-manager
======================

A flexible, dynamic sidebar management package for Laravel applications. This package allows you to define, manipulate, and render your sidebar navigation entirely through code or configuration.

v1.0.0(3mo ago)00MITPHPPHP ^8.2

Since Feb 10Pushed 3mo agoCompare

[ Source](https://github.com/tasmir/sidebar-manager)[ Packagist](https://packagist.org/packages/tasmir/sidebar-manager)[ RSS](/packages/tasmir-sidebar-manager/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

Sidebar Manager for Laravel
===========================

[](#sidebar-manager-for-laravel)

A flexible, dynamic sidebar management package for Laravel applications. This package allows you to define, manipulate, and render your sidebar navigation entirely through code or configuration.

Features
--------

[](#features)

- **Fluent API**: Expressive and easy registration of menu items.
- **Facade Support**: Use the `Sidebar` facade for clean, static-like access.
- **Config Driven**: Define your core sidebar structure in `config/sidebar.php`.
- **Dynamic Manipulation**: Add or modify categories and items at runtime.
- **Permission Based**: Built-in support for Laravel's Gate/Permission system.
- **Blade Component**: Clean rendering using a single `` component.
- **Badges**: Support for static or dynamic (callable) badges.
- **Active State Detection**: Automatic highlighting of active menu items.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require tasmir/sidebar-manager
```

Publish the config file (optional):

```
php artisan vendor:publish --tag="config"
```

Basic Usage
-----------

[](#basic-usage)

### 1. Rendering the Sidebar

[](#1-rendering-the-sidebar)

Place the Blade component in your layout:

```

```

### 2. Static Configuration

[](#2-static-configuration)

You can define your menu in `config/sidebar.php`. You can also remove default categories or specific items:

```
return [
    'menu' => [
        'marketing' => [
            'category' => 'Marketing',
            'order' => 50,
            'items' => [
                'campaigns' => [
                    'label' => 'Campaigns',
                    'route' => 'admin.marketing.campaigns',
                    'icon' => '...',
                    'permission' => 'campaigns_list',
                ],
            ],
        ],
    ],

    // Remove default items or categories
    'remove' => [
        'dashboard', // Removes the entire dashboard category
        'system' => ['activity'], // Removes only the 'activity' item from 'system'
    ],
];
```

### 3. Fluent API (via Facade)

[](#3-fluent-api-via-facade)

You can manipulate the sidebar from anywhere (e.g., controllers, closures, or providers) using the `Sidebar` facade:

```
use Sidebar;

// Add a category
Sidebar::category('settings', [
    'category' => 'Settings',
    'order' => 100,
]);

// Add an item fluently
Sidebar::item('settings', 'profile', [
    'label' => 'My Profile',
    'route' => 'admin.profile.edit',
    'icon' => '...',
]);

// Extending an existing group from another module
Sidebar::item('marketing', 'newsletter', [
    'label' => 'Newsletter',
    'route' => 'admin.marketing.newsletter',
    'icon' => '...',
    'order' => 10, // Items will be sorted by this order
]);

// Remove an item
Sidebar::removeItem('system', 'activity');

// Remove an entire category
Sidebar::removeCategory('dashboard');
```

### 4. Blade Directives

[](#4-blade-directives)

You can also manage the sidebar directly from your Blade templates for view-specific adjustments:

```
{{-- Add a category --}}
@addSidebarCategory('reports', ['category' => 'Reports', 'order' => 60])

{{-- Add an item to a category --}}
@addSidebarItem('reports', 'sales', [
    'label' => 'Sales Report',
    'route' => 'admin.reports.sales',
    'icon' => '...'
])

{{-- Remove items or categories --}}
@removeSidebarItem('system', 'activity')
@removeSidebarCategory('dashboard')

{{-- Finally, render the sidebar --}}

```

Menu Item Configuration
-----------------------

[](#menu-item-configuration)

Each item accepts a configuration array:

KeyTypeDescription`label``string`Display text.`route``string`Laravel route name.`url``string`Fallback URL.`params``array`Route parameters.`icon``string`Raw HTML/SVG for the icon.`active``bool`Active state logic.`permission``string`Required permission.`badge``int|Closure`Static number or closure.`order``int`Sort position.Contributing
------------

[](#contributing)

Contributions are welcome! If you have any ideas, bug fixes, or improvements, feel free to open an issue or submit a pull request on [GitHub](https://github.com/tasmir/sidebar-manager).

---

Developed by [Tasmir](https://github.com/tasmir)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance82

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

96d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/67b661104aac762e04093995cba4c76ef5749be1d336d7150d8c4a8e526174bb?d=identicon)[tasmir](/maintainers/tasmir)

---

Top Contributors

[![tasmir](https://avatars.githubusercontent.com/u/25658870?v=4)](https://github.com/tasmir "tasmir (1 commits)")

### Embed Badge

![Health badge](/badges/tasmir-sidebar-manager/health.svg)

```
[![Health](https://phpackages.com/badges/tasmir-sidebar-manager/health.svg)](https://phpackages.com/packages/tasmir-sidebar-manager)
```

###  Alternatives

[yajra/laravel-datatables-oracle

jQuery DataTables API for Laravel

4.9k33.8M339](/packages/yajra-laravel-datatables-oracle)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[watson/active

Laravel helper for recognising the current route, controller and action

3253.6M14](/packages/watson-active)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[dragon-code/pretty-routes

Pretty Routes for Laravel

10058.7k4](/packages/dragon-code-pretty-routes)[beyondcode/laravel-favicon

Create dynamic favicons based on your environment settings.

37345.5k](/packages/beyondcode-laravel-favicon)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
