PHPackages                             luknei/navigator - 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. luknei/navigator

ActiveLibrary

luknei/navigator
================

07PHP

Since Jun 14Pushed 11y ago1 watchersCompare

[ Source](https://github.com/luknei/laravel-navigator)[ Packagist](https://packagist.org/packages/luknei/navigator)[ RSS](/packages/luknei-navigator/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependenciesVersions (1)Used By (0)

laravel-navigator
=================

[](#laravel-navigator)

I just got tired of writing foreach in foreach in foreach :) So I build simple package for Laravel 4.\* to create any depth menu lists breadcrumbs etc.

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

[](#installation)

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

```
"luknei/navigator": "dev-master"

```

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

```
'Luknei\Navigator\NavigatorServiceProvider',

```

Add this to your facades in app.php:

```
 'Nav' => 'Luknei\Navigator\NavigatorFacade',

```

Usage
-----

[](#usage)

### Adding items to navigator:

[](#adding-items-to-navigator)

```
//First level/depth items:
//menu group - "menu", menu item - "auth", and variables of the template
Nav::group('menu')->add('auth',[
    'title' => trans('auth::base.auth'),
    'href'  => '#',
    'icon'  => 'icon-key',
]);

//Second level/depth items:
//menu group - "menu", menu item - "auth.groups", and variables of the template
Nav::group('menu')->add('auth.groups', [
    'title' => trans('auth::base.groups'),
    'href'  => URL::action('Auth\GroupsController@getAll'),
]);

```

### Setting a template

[](#setting-a-template)

Template for the first level/depth items Templates have few elements:

- @depth() ... @stop
- @foreach ... @endforeach
- @subgroup
- variables you passed when adding element to the group $title, $icon etc

These parameters must be in every template, even though you don't need @subgroup you should use it anyway @subgroup should be placed there where you would have nested @foreach() ... @endforeach

```
    @depth(1)

            @foreach

                     {{ $title }}

                @subgroup

            @endforeach

    @stop

```

You can Set the default template for any level/depth item

```
@depth(default)

        @foreach

                {{ $title }}

            @subgroup

        @endforeach

@stop

```

There are also options for even and odd depth/levels @depth(even) @depth(odd)

### Rendering the menu

[](#rendering-the-menu)

To render your navigation menu simply set the group and use render method The first parameter of render method is your template, usage is the same as you use View::make();

```
Nav::group('admin.menu')->render('partials.sidemenu');

```

If you want to cache your rendered menu for more performance, pass a second parameter - minutes to keep the cache.

```
Nav::group('admin.menu')->render('partials.sidemenu', 20); //cached for 20min

```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

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://www.gravatar.com/avatar/59ee42466e74fde28f079e90d32e1fd608e9c79665795d0024a8d8704ba2633c?d=identicon)[luknei](/maintainers/luknei)

---

Top Contributors

[![lneicelis](https://avatars.githubusercontent.com/u/5556003?v=4)](https://github.com/lneicelis "lneicelis (10 commits)")

### Embed Badge

![Health badge](/badges/luknei-navigator/health.svg)

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

PHPackages © 2026

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