2017 © Pedro Peláez
 

laravel-package active-menu

The helper class for Laravel applications to get active class base on current route name

image

juy/active-menu

The helper class for Laravel applications to get active class base on current route name

  • Thursday, March 16, 2017
  • by angelside
  • Repository
  • 2 Watchers
  • 7 Stars
  • 1,060 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 14 Versions
  • 8 % Grown

The README.md

Active Menu Laravel Package

Latest Version on Packagist ![Software License][ico-license], (*1)

Helper class for Laravel applications to get active class base on current route name (It's only detect "route name, this is enough for us.")., (*2)


Supported/Tested Laravel versions

  • Laravel 5.1 | 5.2 | 5.3 | 5.4

Requirements

  • Laravel >= 5.1 : Laravel 5.1 or above.
  • PHP >= 5.5.9 : PHP 5.5.9 or above on your machine.

Installation

Step:1 Install through composer

Install

➜ composer require juy/active-menu

Manual install (alternative)

Simply add the following to the "require" section of your composer.json file, and run composer update command., (*3)

"juy/active-menu": "^1.1"
  

Remove

➜ composer remove juy/active-menu

Step 2: Add the service provider

Append this line to your service providers array in config/app.php., (*4)

Juy\ActiveMenu\ServiceProvider::class,

Step 3: Publish config

Publish config file., (*5)

➜ php artisan vendor:publish --provider="Juy\ActiveMenu\ServiceProvider" --tag="config"

Config overview

You can modify css active class with custom one (default is 'active') in config/activemenu.php (after publish)., (*6)

return [

    // The default css class value if the request match given route name
    'class' => 'active',

];

Usage, samples

Alias/Facade, (*7)

Active::route('route.name');

Application container, (*8)

app('active')->route('route.name');

Helper function, (*9)

active_route('route.name');

Wildcard samples, (*10)

Active::route('route.name.*');
active_route('route.name.*');

Multi route with wilcard, (*11)

Active::route(['route.name1.*', 'route.name2.*']);
active_route(['route.name1.*', 'route.name2.*']);

Custom blade directive, (*12)

@ifActiveRoute('route.name')
    <p>Foo</p>
@else
    <p>Bar</p>
@endif

Real life usage, (*13)

<li class="item {{ active_route('admin.index') }}">
    <a href="admin/index">Dashboard</a>
</li>

License

This project is open-sourced software licensed under the MIT License., (*14)

The Versions

16/03 2017

dev-master

9999999-dev https://github.com/juy/ActiveMenu

The helper class for Laravel applications to get active class base on current route name

  Sources   Download

MIT

The Requires

 

laravel menu class active

16/03 2017

1.1.3

1.1.3.0 https://github.com/juy/ActiveMenu

The helper class for Laravel applications to get active class base on current route name

  Sources   Download

MIT

The Requires

 

laravel menu class active

16/03 2017

dev-develop

dev-develop https://github.com/juy/ActiveMenu

The helper class for Laravel applications to get active class base on current route name

  Sources   Download

MIT

The Requires

 

laravel menu class active

23/12 2016

1.1.2

1.1.2.0 https://github.com/juy/ActiveMenu

The helper class for Laravel applications to get active class base on current route name

  Sources   Download

MIT

The Requires

 

laravel menu class active

23/09 2016

1.1.1

1.1.1.0 https://github.com/juy/ActiveMenu

The helper class for Laravel applications to get active class base on current route name

  Sources   Download

MIT

The Requires

 

laravel menu class active

18/09 2016

1.1.0

1.1.0.0 https://github.com/juy/ActiveMenu

The helper class for Laravel applications to get active class base on current route name

  Sources   Download

MIT

The Requires

 

laravel menu class active

02/08 2016

1.0.7

1.0.7.0 https://github.com/juy/ActiveMenu

The helper class for Laravel applications to get active class base on current route name

  Sources   Download

MIT

The Requires

 

laravel menu class active

06/04 2016

1.0.6

1.0.6.0 https://github.com/juy/ActiveMenu

The helper class for Laravel applications to get active class base on current route name

  Sources   Download

MIT

The Requires

 

laravel menu class active

04/04 2016

1.0.5

1.0.5.0 https://github.com/juy/ActiveMenu

The helper class for Laravel applications to get active class base on current route name

  Sources   Download

MIT

The Requires

 

laravel menu class active

25/03 2016

1.0.4

1.0.4.0 https://github.com/juy/ActiveMenu

The helper class for Laravel applications to get active class base on current route

  Sources   Download

MIT

The Requires

 

laravel menu class active

22/01 2016

1.0.3

1.0.3.0 https://github.com/juy/ActiveMenu

The helper class for Laravel applications to get active class base on current route

  Sources   Download

MIT

The Requires

 

laravel menu class active

18/01 2016

1.0.2

1.0.2.0 https://github.com/juy/ActiveMenu

The helper class for Laravel applications to get active class base on current route

  Sources   Download

MIT

The Requires

 

laravel menu class active

13/01 2016

1.0.1

1.0.1.0 https://github.com/juy/ActiveMenu

The helper class for Laravel applications to get active class base on current route

  Sources   Download

MIT

The Requires

 

12/01 2016

1.0.0

1.0.0.0 https://github.com/juy/ActiveMenu

The helper class for Laravel applications to get active class base on current route

  Sources   Download

MIT

The Requires