Mise à jour Laravel de 5.5 à 5.6

Upgrade effectué dans une installation quasi standard avec les extensions : jenssegers, laravelcollective et stradmin

Mise à jour Laravel

De la version 5.5 à 5.6

Upgrade effectué avec les extensions :

  • jenssegers/date
  • laravelcollective/html
  • tcg/stradmin

1. éditer le fichier composer.json comme suit :

Dans "require"

 "php": ">=7.1.3",
 "fideloper/proxy": "~4.0",
 "laravel/framework": "5.6.*",

Dans "require-dev"

 "phpunit/phpunit": "~7.0",

2. dans le terminal

cd /path/to/laravel/app

composer update

3. dans config/ créer les fichiers

  • hashing.php
  • logging.php

3.1 Editer config/hashing.php comme suit

<?php

return [

 /*

 |--------------------------------------------------------------------------

 | Default Hash Driver

 |--------------------------------------------------------------------------

 |

 | This option controls the default hash driver that will be used to hash

 | passwords for your application. By default, the bcrypt algorithm is

 | used; however, you remain free to modify this option if you wish.

 |

 | Supported: "bcrypt", "argon"

 |

 */

 'driver' => 'argon',

];

3.2 Editer config/logging.php comme suit

<?php

return [


 /*

 |--------------------------------------------------------------------------

 | Default Log Channel

 |--------------------------------------------------------------------------

 |

 | This option defines the default log channel that gets used when writing

 | messages to the logs. The name specified in this option should match

 | one of the channels defined in the "channels" configuration array.

 |

 */


 'default' => env('LOG_CHANNEL', 'stack'),


 /*

 |--------------------------------------------------------------------------

 | Log Channels

 |--------------------------------------------------------------------------

 |

 | Here you may configure the log channels for your application. Out of

 | the box, Laravel uses the Monolog PHP logging library. This gives

 | you a variety of powerful log handlers / formatters to utilize.

 |

 | Available Drivers: "single", "daily", "slack", "syslog",

 |                    "errorlog", "custom", "stack"

 |

 */
 

 'channels' => [

 'stack' => [

 'driver' => 'stack',

 'channels' => ['single'],

 ],

 
 'single' => [

 'driver' => 'single',

 'path' => storage_path('logs/laravel.log'),

 'level' => 'debug',

 ],

 
 'daily' => [

 'driver' => 'daily',

 'path' => storage_path('logs/laravel.log'),

 'level' => 'debug',

 'days' => 7,

 ],
 

 'slack' => [

 'driver' => 'slack',

 'url' => env('LOG_SLACK_WEBHOOK_URL'),

 'username' => 'Laravel Log',

 'emoji' => ':boom:',

 'level' => 'critical',

 ],
 

 'syslog' => [

 'driver' => 'syslog',

 'level' => 'debug',

 ],
 

 'errorlog' => [

 'driver' => 'errorlog',

 'level' => 'debug',

 ],

 ],
 

];

4. éditer le fichier app/Http/Middleware/TrustProxies.php comme suit

<?php
namespace App\Http\Middleware;
 

use Illuminate\Http\Request;

use Fideloper\Proxy\TrustProxies as Middleware;
 

class TrustProxies extends Middleware

{

 /**

 * The trusted proxies for this application.

 *

 * @var array

 */

 protected $proxies;
 

 /**

 * The headers that should be used to detect proxies.

 *

 * @var string

 */

 protected $headers = Request::HEADER_X_FORWARDED_ALL;

}

5. pour finir

composer update

C'est tout, moins de 10 minutes et tout fonctionne.


Publication : vendredi 1 juin 2018 à 06:34
Mis à jour : mercredi 26 février 2020 à 12:31
Article vue 7277 fois

Mise à jour Laravel de 5.5 à 5.6
Haut de page