Skip to content

Commit

Permalink
Update for Laravel 5.8: docs and use Arr::get instead of array_get
Browse files Browse the repository at this point in the history
  • Loading branch information
clemir committed Mar 4, 2019
1 parent 057ecaf commit b93eda3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
8 changes: 6 additions & 2 deletions LEEME.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ Styde Html es una extensión del [paquete HTML de Laravel Collective](https://gi

1. La mejor forma de instalar este paquete es a través de Composer.

**Para Laravel 5.8**:

Instala ejecutando `composer require "styde/html=~1.7"` o agregando `"styde/html": "~1.7"` a tu archivo `composer.json` y luego ejecuta `composer update`.

**Para Laravel 5.7**:

Instala ejecutando `composer require "styde/html=~1.6"` o agregando `"styde/html": "~1.6"` a tu archivo `composer.json` y luego ejecuta `composer update`.
Expand Down Expand Up @@ -51,10 +55,10 @@ Instala ejecutando `composer require "styde/html=~1.0"` o agregando `"styde/html
],
```

3. Agrega el middleware `\Styde\Html\Alert\Middleware::class` **ANTES** del middleware `EncryptCookies` que se encuentra en el array `$middleware` (si es Laravel 5.1, 5.2 y 5.3) o en el array `$middlewareGroups` (en Laravel 5.4) del archivo `app/Http/Kernel.php` :
3. Agrega el middleware `\Styde\Html\Alert\Middleware::class` **ANTES** del middleware `EncryptCookies` que se encuentra en el array `$middleware` (si es Laravel 5.1, 5.2 y 5.3) o en el array `$middlewareGroups` (en Laravel 5.4 y posteriores) del archivo `app/Http/Kernel.php` :

```php
// Para Laravel 5.4
// Para Laravel 5.4 y posteriores
protected $middlewareGroups = [
\Styde\Html\Alert\Middleware::class,
//...
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ This is an extension of the Laravel Collective [HTML package](https://github.com

1. The preferred way to install this package is through Composer:

**Laravel 5.8 users**:

Install by running `composer require "styde/html=~1.7"` or adding `"styde/html": "~1.7"` to your `composer.json` file and then running `composer update`.

**Laravel 5.7 users**:

Install by running `composer require "styde/html=~1.6"` or adding `"styde/html": "~1.6"` to your `composer.json` file and then running `composer update`.
Expand Down Expand Up @@ -56,10 +60,10 @@ Install by running `composer require "styde/html=~1.0"` or adding `"styde/html":
],
```

3. Also, you need to register in the `app/Http/Kernel.php` file the `\Styde\Html\Alert\Middleware::class` middleware **BEFORE** the `EncryptCookies` middleware. For Laravel 5.4, it's in the `$middlewareGroups` array and for previous versions (Laravel 5.3, 5.2, 5.1) it's in the `$middleware` array:
3. Also, you need to register in the `app/Http/Kernel.php` file the `\Styde\Html\Alert\Middleware::class` middleware **BEFORE** the `EncryptCookies` middleware. For Laravel 5.4 and later, it's in the `$middlewareGroups` array and for previous versions (Laravel 5.3, 5.2, 5.1) it's in the `$middleware` array:

```php
// For Laravel 5.4 and 5.5
// For Laravel 5.4 and later
protected $middlewareGroups = [
\Styde\Html\Alert\Middleware::class,
//...
Expand Down
15 changes: 8 additions & 7 deletions src/HtmlServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@

namespace Styde\Html;

use Styde\Html\Menu\Menu;
use Styde\Html\Menu\MenuGenerator;
use Styde\Html\Access\AccessHandler;
use Collective\Html\HtmlServiceProvider as ServiceProvider;
use Illuminate\Contracts\Auth\Access\Gate;
use Illuminate\Foundation\AliasLoader;
use Styde\Html\Alert\Container as Alert;
use Illuminate\Support\Arr;
use Styde\Html\Access\AccessHandler;
use Styde\Html\Access\BasicAccessHandler;
use Illuminate\Contracts\Auth\Access\Gate;
use Styde\Html\Alert\Container as Alert;
use Styde\Html\Alert\Middleware as AlertMiddleware;
use Styde\Html\Alert\SessionHandler as AlertSessionHandler;
use Collective\Html\HtmlServiceProvider as ServiceProvider;
use Styde\Html\Menu\Menu;
use Styde\Html\Menu\MenuGenerator;

class HtmlServiceProvider extends ServiceProvider
{
Expand Down Expand Up @@ -89,7 +90,7 @@ protected function loadConfigurationOptions()

$this->options = $this->app->make('config')->get('html');

$this->options['theme_values'] = array_get($this->options['themes'], $this->options['theme']);
$this->options['theme_values'] = Arr::get($this->options['themes'], $this->options['theme']);

unset ($this->options['themes']);
}
Expand Down

0 comments on commit b93eda3

Please sign in to comment.