PHPackages                             graham-campbell/navigation - 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. [Framework](/categories/framework)
4. /
5. graham-campbell/navigation

AbandonedArchivedLibrary[Framework](/categories/framework)

graham-campbell/navigation
==========================

Navigation Is A Navigation Bar Generator For Laravel 5

v2.2.0(10y ago)3421.9k122MITPHPPHP &gt;=5.5.9

Since Dec 12Pushed 8y ago1 watchersCompare

[ Source](https://github.com/BootstrapCMS/Navigation)[ Packagist](https://packagist.org/packages/graham-campbell/navigation)[ RSS](/packages/graham-campbell-navigation/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (10)Dependencies (6)Versions (13)Used By (2)

Laravel Navigation
==================

[](#laravel-navigation)

Laravel Navigation was created by, and is maintained by [Graham Campbell](https://github.com/GrahamCampbell), and is a navigation bar generator for [Laravel 5](http://laravel.com). Feel free to check out the [releases](https://github.com/BootstrapCMS/Navigation/releases), [license](LICENSE), and [contribution guidelines](CONTRIBUTING.md).

[![Laravel Navigation](https://cloud.githubusercontent.com/assets/2829600/4432308/c153cd00-468c-11e4-9fc0-4776b482e6ef.PNG)](https://cloud.githubusercontent.com/assets/2829600/4432308/c153cd00-468c-11e4-9fc0-4776b482e6ef.PNG)

[![Build Status](https://camo.githubusercontent.com/193f76a67762412c58a162c9abfcc5fcbf905d57b47f745dc0165c1d1669f4e3/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f426f6f747374726170434d532f4e617669676174696f6e2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/BootstrapCMS/Navigation)[![Coverage Status](https://camo.githubusercontent.com/e6c95f7aa09e8f2a0f3ee63fdbfa3167192b08c7d380f861517864c58891cbcc/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f426f6f747374726170434d532f4e617669676174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/BootstrapCMS/Navigation/code-structure)[![Quality Score](https://camo.githubusercontent.com/32bf7ee5bda74c28567e229b68e45b8fa0c9d31440175c4f94f50812245f55f7/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f426f6f747374726170434d532f4e617669676174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/BootstrapCMS/Navigation)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Latest Version](https://camo.githubusercontent.com/ec6d82619981dffcba9f6fa10c6cb520a8ad00b8794cba6593879c1004649562/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f426f6f747374726170434d532f4e617669676174696f6e2e7376673f7374796c653d666c61742d737175617265)](https://github.com/BootstrapCMS/Navigation/releases)

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

[](#installation)

[PHP](https://php.net) 5.5+ or [HHVM](http://hhvm.com) 3.6+, and [Composer](https://getcomposer.org) are required.

To get the latest version of Laravel Navigation, simply add the following line to the require block of your `composer.json` file:

```
"graham-campbell/navigation": "~2.2"

```

You'll then need to run `composer install` or `composer update` to download it and have the autoloader updated.

Once Laravel Navigation is installed, you need to register the service provider. Open up `config/app.php` and add the following to the `providers` key.

- `'GrahamCampbell\Navigation\NavigationServiceProvider'`

You can register the Navigation facade in the `aliases` key of your `config/app.php` file if you like.

- `'Navigation' => 'GrahamCampbell\Navigation\Facades\Navigation'`

Configuration
-------------

[](#configuration)

Laravel Navigation requires no configuration. Just follow the simple install instructions and go!

Usage
-----

[](#usage)

##### Navigation

[](#navigation)

This is the class of most interest. It is bound to the ioc container as `'navigation'` and can be accessed using the `Facades\Navigation` facade. There are three public methods of interest.

The `'addToMain'` and `'addToBar'` methods will add the item to the internal main navigation array in the specified way. These methods both accept three arguments. All but the first are optional. The first argument must be an array. It must have either a `'slug'` key or a `'url'` key where the slug is the target url relative to the base url, and the url is a full url you may specify (useful to link to somewhere outside the application). It must also have a `'title'` key which will specify the title, and you may also optionally add an `'icon'` key which will at the relevant icon from font awesome to the mix. The second parameter specifies which navigation bar you want to add to. By default this is `'default'`, but you may have mutliple navigation bars, for example, [Bootstrap CMS](https://github.com/BootstrapCMS/CMS) has an `'admin'` navigation bar. The final parameter specifies if the item should be prepended to the internal array. By default this is `false`.

The third method is `'render'`, and accepts three arguments. All arguments are optional. The fist argument selects the main navigation bar you which to return. By default this is set to `'default'`. The third argument selection the bar navigation bar you wish to return. By default this is set to `false`, where by no bar navigation is returned. You may set this to any string to return the relevant navigation bar. The final parameter is an array of variables you wish to pass to the navigation view. The default is `['title' => 'Navigation', 'side' => 'dropdown', 'inverse' => true]`.

Note that the navigation bar referred to as `'main'` is the navigation bar that will go across the top of your page, and the navigation bar referred to as `'bar'` is the navigation bar that will be a dropdown at the side. These are also referred to in the context of the default view provided with this package (for Twitter Bootstrap 3).

Also note that the render method will emit events so you can call the addTo methods lazily. The events emitted are `'navigation.main'` and `'navigation.bar'`, which are emitted just before the render method starts to deal with the each navigation bar. The name of the selected navigation bar is also emitted. Check out the [source](https://github.com/BootstrapCMS/Navigation/blob/master/src/Navigation.php).

##### Facades\\Navigation

[](#facadesnavigation)

This facade will dynamically pass static method calls to the `'navigation'` object in the ioc container which by default is the `Navigation` class.

##### NavigationServiceProvider

[](#navigationserviceprovider)

This class contains no public methods of interest. This class should be added to the providers array in `config/app.php`. This class will setup ioc bindings.

License
-------

[](#license)

Laravel Navigation is licensed under [The MIT License (MIT)](LICENSE).

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity36

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity65

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 ~55 days

Recently: every ~74 days

Total

12

Last Release

3930d ago

Major Versions

v0.4.0-alpha → v1.0.0-beta12014-07-24

v1.0.2 → v2.0.02015-02-05

PHP version history (3 changes)v0.1.1-alphaPHP &gt;=5.3.3

v0.2.0-alphaPHP &gt;=5.4.7

v2.1.0PHP &gt;=5.5.9

### Community

Maintainers

![](https://www.gravatar.com/avatar/d95eb26cb8f3919bb5ca3b6d823daeabbf259663778a970349b245c580713c8e?d=identicon)[graham-campbell](/maintainers/graham-campbell)

---

Top Contributors

[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (203 commits)")

---

Tags

frameworklaravelGraham CampbellGrahamCampbellnavigationLaravel-Navigationnavigation generatornavigation bar

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/graham-campbell-navigation/health.svg)

```
[![Health](https://phpackages.com/badges/graham-campbell-navigation/health.svg)](https://phpackages.com/packages/graham-campbell-navigation)
```

###  Alternatives

[graham-campbell/markdown

Markdown Is A CommonMark Wrapper For Laravel

1.3k7.1M64](/packages/graham-campbell-markdown)[graham-campbell/manager

Manager Provides Some Manager Functionality For Laravel

39221.1M134](/packages/graham-campbell-manager)[graham-campbell/throttle

Throttle Is A Rate Limiter For Laravel

7102.3M11](/packages/graham-campbell-throttle)[graham-campbell/github

GitHub Is A GitHub Bridge For Laravel

6411.7M19](/packages/graham-campbell-github)[graham-campbell/exceptions

Provides A Powerful Error Response System For Both Development And Production

5911.3M4](/packages/graham-campbell-exceptions)[graham-campbell/digitalocean

DigitalOcean Is A DigitalOcean Bridge For Laravel

509343.1k2](/packages/graham-campbell-digitalocean)

PHPackages © 2026

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