PHPackages                             lucadello91/laravel-active - 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. lucadello91/laravel-active

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

lucadello91/laravel-active
==========================

Laravel helper for detecting active navigation menu items and applying bootstrap classes.

2.0(8y ago)0912[1 issues](https://github.com/lucadello91/laravel-active/issues)MITPHPPHP &gt;=5.3.0

Since Jan 30Pushed 7y ago1 watchersCompare

[ Source](https://github.com/lucadello91/laravel-active)[ Packagist](https://packagist.org/packages/lucadello91/laravel-active)[ Docs](https://github.com/lucadello91/laravel-active)[ RSS](/packages/lucadello91-laravel-active/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (1)Dependencies (1)Versions (5)Used By (0)

Laravel-Active
==============

[](#laravel-active)

[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Packagist Version](https://camo.githubusercontent.com/42a07bdf247c99386f63ff4af9d7be5bf72c682991650ee5c0427b83fed8e086/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c75636164656c6c6f39312f6c61726176656c2d6163746976652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lucadello91/laravel-active)[![Total Downloads](https://camo.githubusercontent.com/e6a765d95cd1b176472639402dfa002dad07585de46a543ef04a414da8790401/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c75636164656c6c6f39312f6c61726176656c2d6163746976652e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lucadello91/laravel-active)

Laravel helper that detects active navigation menu items and applies bootstrap classes. This is an implementation of . In this implementation, you can use it with resouce name too.

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

[](#installation)

First, pull in the package through Composer.

```
"require": {
    "lucadello91/laravel-active": "^2.0"
}
```

And then, if using Laravel 5 or 4, include the service provider within `app/config/app.php`.

```
'providers' => [
    Lucadello91\Active\LaravelActiveServiceProvider::class
];
```

And, for convenience, add a facade alias to this same file at the bottom:

```
'aliases' => [
    'Active'    => Lucadello91\Active\Facades\LaravelActive::class
];
```

Usage
-----

[](#usage)

You would most likely use this package in your `navbar` partial like so:

```

         Home

         Location

            Murter

            Kornati

         Trips

```

API
---

[](#api)

As the second parameter to any method, you can pass the value you want to get returned if there was a match. *By default this is `active` which is Bootstrap default.*

As the third parameter to any method, you can pass the value you want to get returned if there wasn't a match. *By default this is empty string.*

#### `isActiveRoute($routeName, $active = "active", $notActive = "")`

[](#isactiverouteroutename-active--active-notactive--)

Compares given route name with current route name.

```
{{ Active::isActiveRoute('home') }}
```

#### `isActiveRouteResourceName($resourceName, $active = "active", $notActive = "")`

[](#isactiverouteresourcenameresourcename-active--active-notactive--)

Compares given resource name with current Route::Resource name.

```
{{ Active::isActiveRouteResourceName('home') }}
```

#### `isActiveURL($url, $active = "active", $notActive = "")`

[](#isactiveurlurl-active--active-notactive--)

Compares given URL with current URL.

```
{{ Active::isActiveURL('/about') }}
```

#### `isActiveMatch($string, $active = "active", $notActive = "")`

[](#isactivematchstring-active--active-notactive--)

Detects if the given string is found in the current URL.

```
{{ Active::isActiveMatch('bout') }}
```

#### `areActiveRoutes(array $routeNames, $active = "active", $notActive = "")`

[](#areactiveroutesarray-routenames-active--active-notactive--)

Compares given array of route names with current route name.

```
{{ Active::areActiveRoutes(['product.index', 'product.show']) }}
```

#### `areActiveRoutesResourcesNames(array $resourcesNames, $active = "active", $notActive = "")`

[](#areactiveroutesresourcesnamesarray-resourcesnames-active--active-notactive--)

Compares given array of resource names with current Route::Resource name.

```
{{ Active::areActiveRoutesResourcesNames(['post', 'comments']) }}
```

#### `areActiveURLs(array $urls, $active = "active", $notActive = "")`

[](#areactiveurlsarray-urls-active--active-notactive--)

Compares given array of URLs with current URL.

```
{{ Active::areActiveURLs(['/product', '/product/create']) }}
```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

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

Total

4

Last Release

3199d ago

Major Versions

1.1 → 2.02017-08-08

### Community

Maintainers

![](https://www.gravatar.com/avatar/d62024361cd6e4a0044afa9454baee1ae98da8e7dd417644fc63acd7d2f7276c?d=identicon)[lucadello91](/maintainers/lucadello91)

---

Top Contributors

[![lucadello91](https://avatars.githubusercontent.com/u/11389657?v=4)](https://github.com/lucadello91 "lucadello91 (11 commits)")

---

Tags

laravelhelperbootstrapnavigation

### Embed Badge

![Health badge](/badges/lucadello91-laravel-active/health.svg)

```
[![Health](https://phpackages.com/badges/lucadello91-laravel-active/health.svg)](https://phpackages.com/packages/lucadello91-laravel-active)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[nwidart/laravel-menus

Laravel Menu management

168180.3k10](/packages/nwidart-laravel-menus)[pingpong/menus

Laravel Menus

70194.4k13](/packages/pingpong-menus)[akaunting/laravel-menu

Menu and sidebar management package for Laravel

38233.8k](/packages/akaunting-laravel-menu)[rinvex/laravel-menus

Rinvex Menus is a simple menu builder package for Laravel, that supports hierarchical structure, ordering, and styling with full flexibility using presenters for easy styling and custom structure of menu rendering.

294.0k20](/packages/rinvex-laravel-menus)[nedwors/navigator

A Laravel package to ease defining navigation menus

433.1k](/packages/nedwors-navigator)

PHPackages © 2026

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