Download the PHP package lucadello91/laravel-active without Composer
On this page you can find all versions of the php package lucadello91/laravel-active. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lucadello91/laravel-active
More information about lucadello91/laravel-active
Files in lucadello91/laravel-active
Package laravel-active
Short Description Laravel helper for detecting active navigation menu items and applying bootstrap classes.
License MIT
Homepage https://github.com/lucadello91/laravel-active
Informations about the package laravel-active
Laravel-Active
Laravel helper that detects active navigation menu items and applies bootstrap classes. This is an implementation of https://github.com/laravelista/Ekko. In this implementation, you can use it with resouce name too.
Installation
First, pull in the package through Composer.
And then, if using Laravel 5 or 4, include the service provider within app/config/app.php
.
And, for convenience, add a facade alias to this same file at the bottom:
Usage
You would most likely use this package in your navbar
partial like so:
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 = "")
Compares given route name with current route name.
isActiveRouteResourceName($resourceName, $active = "active", $notActive = "")
Compares given resource name with current Route::Resource name.
isActiveURL($url, $active = "active", $notActive = "")
Compares given URL with current URL.
isActiveMatch($string, $active = "active", $notActive = "")
Detects if the given string is found in the current URL.
areActiveRoutes(array $routeNames, $active = "active", $notActive = "")
Compares given array of route names with current route name.
areActiveRoutesResourcesNames(array $resourcesNames, $active = "active", $notActive = "")
Compares given array of resource names with current Route::Resource name.
areActiveURLs(array $urls, $active = "active", $notActive = "")
Compares given array of URLs with current URL.