The helper class for Laravel applications to get active class base on current route
[!CAUTION]
This repository is not maintained any more. Please feel free to fork it and make it compatible to new versions of Laravel.
The helper class for Laravel applications to get active class base on current url.
Since version 7.0, the major version of this library will match the major version of Laravel.
Laravel version | Active library version |
---|---|
>= 7.x | >= 7.x |
6.x | 4.x |
5.x | 3.x |
4.x | 1.x |
Require this package as your dependencies:
composer require hieu-le/active
If you are using Laravel 5.5+, you do not need to manually register the ServiceProvider and Alias.
Append this line to your providers
array in config/app.php
HieuLe\Active\ActiveServiceProvider::class,
Append this line to your aliases
array in config/app.php
'Active' => HieuLe\Active\Facades\Active::class,
See: How to use Active
if_*
functions to be string or array