PHPackages                             bumbummen99/bs4menu - 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. bumbummen99/bs4menu

AbandonedArchivedLibrary

bumbummen99/bs4menu
===================

Dynamic menu builder for Bootstrap 4.

1.1(8y ago)013MITPHPPHP &gt;=5.4.0

Since Feb 22Pushed 8y agoCompare

[ Source](https://github.com/bumbummen99/php-menu)[ Packagist](https://packagist.org/packages/bumbummen99/bs4menu)[ RSS](/packages/bumbummen99-bs4menu/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (1)Versions (24)Used By (0)

Menu Builder [![Build Status](https://camo.githubusercontent.com/1e61fb2ff2b879f6c70ee11aad22d1afbddc44c704cd4ef035e82090d011087b/68747470733a2f2f7472617669732d63692e6f72672f616e6c7574726f2f7068702d6d656e752e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/anlutro/php-menu) [![Latest Version](https://camo.githubusercontent.com/21d49e9a8a2dd0cc9b5dae7e9ddf5f3f57ccd7ed8e778b32dc1befbb89b316ca/687474703a2f2f696d672e736869656c64732e696f2f6769746875622f7461672f616e6c7574726f2f7068702d6d656e752e737667)](https://github.com/anlutro/php-menu/releases)
==============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#menu-builder---)

Simple dynamic menu building system.

PHP framework agnostic. The default renderer uses Bootstrap 3 class names and markup.

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

[](#installation)

`composer require anlutro/menu` - pick the latest tag visible in the github tag list or on packagist.

#### Laravel 4

[](#laravel-4)

Add `bs4menu\ServiceProvider` to the list of providers in app/config/app.php. Optionally, add an alias for `'Menu' => 'bs4menu\Facade'` as well. The menu builder instance can be accessed via the facade or via automatic dependency injection by type hinting.

Do `artisan config:publish anlutro/menu` to change the default Bootstrap 3-specific settings.

Usage
-----

[](#usage)

Set up a shared instance of Menu\\Builder. Create the menus you need.

```
$builder = new bs4menu\Builder;
$menu = $builder->createMenu('left');
```

If you're using Laravel 4, you can use `Menu::` instead of `$builder->` provided you set up an alias as shown in the installation instructions above.

From here, you can add items to your menus from anywhere.

```
$menu->addItem('Item 1', '/my-uri');

// you can add custom html attributes to your items
$menu->addItem('Item 2', '/my-uri', ['class' => 'custom-class']);

// use priorities to push items to the top or bottom of your menu
// items have priority 0 by default.
$menu->addItem('First item', '/my-uri', [], -50);
$menu->addItem('Last item', '/my-uri', [], 50);
```

Adding submenus works similarly.

```
$submenu = $menu->addSubmenu('Sub Menu');
$submenu->addItem('Sub item 1', '/my-uri');
```

When you want to render a menu, call render($menu) and echo it.

```
echo $builder->render('left');
```

By default, Bootstrap 3-specific classes are used. If you want to use something else, you need to create your own class implementation of `bs4menu\Renderers\RendererInterface` and either do `$builder->setDefaultRenderer('MyRenderer')` or `$builder->render('name_of_menu', $myRenderer)`.

Contact
-------

[](#contact)

Open an issue on GitHub if you have any problems or suggestions.

License
-------

[](#license)

The contents of this repository is released under the [MIT license](http://opensource.org/licenses/MIT).

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity68

Established project with proven stability

 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

Every ~69 days

Recently: every ~265 days

Total

22

Last Release

2992d ago

Major Versions

0.6.2 → 1.02018-02-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/509a5baf8d7d8f7ae8c5b569ee81b1d04ed6af1af625696777e51e997ff9a685?d=identicon)[bumbummen99](/maintainers/bumbummen99)

---

Top Contributors

[![anlutro](https://avatars.githubusercontent.com/u/163093?v=4)](https://github.com/anlutro "anlutro (48 commits)")

### Embed Badge

![Health badge](/badges/bumbummen99-bs4menu/health.svg)

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

PHPackages © 2026

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