Skip to content

Commit

Permalink
Merge pull request #22 from it-can/master
Browse files Browse the repository at this point in the history
Laravel 5.5 auto-discovery
  • Loading branch information
Mario Bašić authored Sep 7, 2017
2 parents 7e09b57 + 1aa99c7 commit 7764750
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 28 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ language: php

php:
- 5.6
- hhvm
- 7.0
- 7.1

before_script:
- travis_retry composer self-update
- travis_retry composer install --prefer-dist --no-interaction --dev

script:
script:
- vendor/bin/phpunit
10 changes: 10 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,15 @@
"require-dev": {
"phpunit/phpunit": "^5.3",
"mockery/mockery": "^0.9.4"
},
"extra": {
"laravel": {
"providers": [
"Laravelista\\Ekko\\EkkoServiceProvider"
],
"aliases": {
"Ekko": "Laravelista\\Ekko\\Facades\\Ekko"
}
}
}
}
54 changes: 28 additions & 26 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,34 @@

Ekko is a Laravel helper package. It helps you mark currently active menu item in your navbar.

## Installation

From the command line:

```bash
composer require laravelista/ekko
```

Laravel 5.5+ will use the auto-discovery function.

If using 5.4 (or if you are not using auto-discovery) you will need to include the service providers / facade in `config/app.php`:

```php
'providers' => [
...,
Laravelista\Ekko\EkkoServiceProvider::class
];
```

And add a facade alias to the same file at the bottom:

```php
'aliases' => [
...,
'Ekko' => Laravelista\Ekko\Facades\Ekko::class
];
```

## Overview

To mark a menu item active in [Bootstrap](http://getbootstrap.com/components/#navbar), you need to add a `active` CSS class to the `<li>` tag:
Expand Down Expand Up @@ -56,32 +84,6 @@ Using boolean `true` or `false` is convenient if you need to display some conten
@endif
```

## Installation

From the command line:

```bash
composer require laravelista/ekko
```

Include the service provider in `config/app.php`:

```php
'providers' => [
...,
Laravelista\Ekko\EkkoServiceProvider::class
];
```

And add a facade alias to the same file at the bottom:

```php
'aliases' => [
...,
'Ekko' => Laravelista\Ekko\Facades\Ekko::class
];
```

## API

There are two ways of using Ekko in your application, by using a facade `Ekko::isActiveURL('/about')` or by using a helper function `isActiveURL('/about')`.
Expand Down

0 comments on commit 7764750

Please sign in to comment.