PHPackages                             zning/laravelsidebar - 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. zning/laravelsidebar

ActiveLibrary

zning/laravelsidebar
====================

this is sidebar package base on bootstrap3

0121PHP

Since Dec 13Pushed 8y ago1 watchersCompare

[ Source](https://github.com/lizhenning87/lsidebar-for-laravel)[ Packagist](https://packagist.org/packages/zning/laravelsidebar)[ RSS](/packages/zning-laravelsidebar/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

LSideBar-For-Laravel
====================

[](#lsidebar-for-laravel)

> 参考 davejamesmiller/laravel-breadcrumbs 实现的侧边栏

### Feature

[](#feature)

1. 基础框架
2. 支持自定义的侧边栏样式

### 1. 安装 LSideBar

[](#1-安装-lsidebar)

在控制台中运行此命令

```

composer require zning/laravelsidebar

```

此命令运行后将会自动更新 `composer.json` 文件，并将扩展包安装在`vendor/`目录中

### 2. 配置 LSideBar

[](#2-配置-lsidebar)

在项目config文件夹中，找到app.php

编辑如下对应内容

找到`providers`数组，添加 `Zning\LaravelSideBar\LSideBarServiceProvider::class,`

```
'providers' =>
[
    Zning\LaravelSideBar\LSideBarServiceProvider::class,
]

```

找到`aliases`数组，添加 `'LSideBar' => \Zning\LaravelSideBar\LSideBarFacade::class,`

```

'aliases' =>
[
    'LSideBar' => \Zning\LaravelSideBar\LSideBarFacade::class,
]

```

### 3. 发布 LSideBar

[](#3-发布-lsidebar)

在控制台中运行此命令

```

php artisan vendor:publish

```

此命令运行后会自动在config文件夹中生成lsidebar.php配置文件

### 4. 部署 LSideBar

[](#4-部署-lsidebar)

在`routes`文件夹中新建`lsidebar.php`文件，文件内容如下:

> 若没有找到routes文件夹，也可以在`Http`文件夹中创建此文件

```

LSideBar::register('goods', function ($sidebars){

    $sidebars->push('商品管理', '', ['icon' => 'fa fa-table']);

});

LSideBar::register('goods-list', function ($sidebars){

    $sidebars->parent('goods');
    $sidebars->push('商品列表', route('goods-list'));

});

```

在后台管理页面中找到对应的侧边栏位置，部署如下代码：

```

@yield('LSideBar')

```

在每个管理页面中，部署如下代码：

```

@section('LSideBar')

    {!! LSideBar::render('goods-list') !!}

@endsection

```

### 默认主题

[](#默认主题)

```

bootstrap
bootstrap2

```

### 注意事项

[](#注意事项)

```

[Symfony\Component\Debug\Exception\FatalThrowableError]
Class 'Zning\LaravelSideBar\LSideBarServiceProvider' not found

```

如果使用中遇到上面的错误，请使用`composer dump-autoload -o`

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3361971?v=4)[Lzning](/maintainers/lizhenning87)[@lizhenning87](https://github.com/lizhenning87)

---

Top Contributors

[![lizhenning87](https://avatars.githubusercontent.com/u/3361971?v=4)](https://github.com/lizhenning87 "lizhenning87 (13 commits)")

### Embed Badge

![Health badge](/badges/zning-laravelsidebar/health.svg)

```
[![Health](https://phpackages.com/badges/zning-laravelsidebar/health.svg)](https://phpackages.com/packages/zning-laravelsidebar)
```

PHPackages © 2026

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