Skip to content

Commit 9302868

Browse files
committed
Merged develop into master
2 parents cc93e6c + a50cee3 commit 9302868

File tree

3 files changed

+28
-15
lines changed

3 files changed

+28
-15
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
All notable changes to this project will be documented in this file. This project is versioned under the [Semantic Versioning](http://semver.org/) guidelines.
44

5+
## v1.1.3
6+
7+
- Add CLI control to ServiceProvider
8+
- Auto register Facade on ServiceProvider
9+
510
## v1.1.2
611

712
- Add extra control to "Convert to array"

README.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Active Menu Laravel Package
22

3-
[![Latest version](https://img.shields.io/github/release/juy/ActiveMenu.svg?style=flat-square&label=Latest version)](https://github.com/juy/ActiveMenu/tags) [![Software license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](LICENSE.txt)
3+
[![Latest Version on Packagist][ico-version]][link-packagist] [![Software License][ico-license]](LICENSE.txt)
44

55
> 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.")*.
66
77
----------
88

9-
### Supported Laravel versions
9+
### Supported/Tested Laravel versions
1010

11-
- Laravel **5.1** | **5.2** | **5.3**
11+
- Laravel **5.1** | **5.2** | **5.3** | **5.4**
1212

1313
### Requirements
1414

@@ -23,15 +23,15 @@
2323
#### Install
2424

2525
```
26-
➜ composer require juy/active-menu:1.1.*
26+
➜ composer require juy/active-menu
2727
```
2828

2929
> #### Manual install (alternative)
3030
3131
> Simply add the following to the "require" section of your composer.json file, and run `composer update` command.
3232
3333
> ```json
34-
>"juy/active-menu": "1.1.*"
34+
>"juy/active-menu": "^1.1"
3535
>```
3636
3737
#### Remove
@@ -48,15 +48,7 @@ Append this line to your **service providers** array in `config/app.php`.
4848
Juy\ActiveMenu\ServiceProvider::class,
4949
```
5050

51-
### Step 3: Add facade
52-
53-
Append this line to your **aliases** array in `config/app.php`.
54-
55-
```php
56-
'Active' => Juy\ActiveMenu\Facades\Active::class,
57-
```
58-
59-
### Step 4: Publish config
51+
### Step 3: Publish config
6052

6153
Publish config file.
6254

@@ -138,4 +130,10 @@ Real life usage
138130

139131
### License
140132

141-
This project is open-sourced software licensed under the [MIT License](LICENSE.txt).
133+
This project is open-sourced software licensed under the [MIT License](LICENSE.txt).
134+
135+
136+
[ico-version]: https://img.shields.io/packagist/v/juy/active-menu.svg?style=flat-square
137+
[link-packagist]: https://packagist.org/packages/juy/active-menu
138+
139+
[ico-license]: https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square

src/ServiceProvider.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,23 @@ class ServiceProvider extends BaseServiceProvider
4141
*/
4242
public function register()
4343
{
44+
// If script is running CLI we don't activate this plugin
45+
if ($this->app->runningInConsole())
46+
{
47+
return;
48+
}
49+
4450
// Default package configuration
4551
$this->mergeConfig();
4652

4753
// Register singleton
4854
$this->app->singleton('active', function ($app) {
4955
return new Active($app['router']->current()->getName());
5056
});
57+
58+
// Register Facade
59+
$loader = \Illuminate\Foundation\AliasLoader::getInstance();
60+
$loader->alias('Active', Facades\Active::class);
5161
}
5262

5363
/**

0 commit comments

Comments
 (0)