post thumbnail

Easiest way to upgrade from Laravel 5.2 to 5.5

Posted By : KayAdmin | Date : Feb-15-2018

Laravel update can be challenging and stressful if you don’t know how to go about it and at the same time did not have the right information for the upgrade. Laravel provides an upgrade guide here.

Upgrade guide:

You may also refer to it, but the information here is sufficient for the process to get done.

Two things to note is:

Laravel 5.5 requires PHP 7.0.0 or higher. This means your web host or local server (E.G. Wamp or Zamp) installed on your computer should support PHP 7.0.0 or higher.

And secondly, after the upgrade, you may need to manually alter few files.

The Process


Navigate to ROOT directory and open up the composer.json file and then update the following information.

  1. Under “require” section, change “laravel/framework” from your old version to 5.5.* Also change PHP to 7.0.0
  2. Under “require-dev” section, change “phpunit/phpunit” to ~6.0
  3. Under “require-dev” section, add filp/whoops package with version ~2.0 (E.G. "filp/whoops": "~2.0",)
  4. Finally, in the scripts section, add the package:discover command to the post-autoload-dump event as seen below

"scripts": {


   "post-autoload-dump": [


       "@php artisan package:discover"




  1. Now save the composer.json and run composer update command just like you run php artisan serve. Make sure you are connected to internet. The update should be done in a little time.


Another way to do this, which I usually follow, is to get Laravel 5.5 downloaded to your computer and update it composer.json file against the old one. (I.E. Open the composer.json file and copy all. Now go to your old laravel file and open the composer.json file, highlight and delete all, then paste new composer content).

Save and run composer update command.


Errors to fix after update

ErrorException (E_WARNING) 

Declaration of App\Providers\EventServiceProvider::boot(

Declaration of App\Providers\EventServiceProvider::boot(Illuminate\Contracts\Events\Dispatcher $events) should be compatible with Illuminate\Foundation\Support\Providers\EventServiceProvider::boot()


Remove the parameter inside the method boot() in this two files:

  1. App\Providers\RouteServiceProvider
  2. App\Providers\EventServiceProvider

  E.g.public function boot(/*original something here. empty it*/)


   parent::boot(/*original something here. empty it*/);



Symfony \ Component \ Debug \ Exception \ FatalErrorException (E_UNKNOWN)

Trait ’Illuminate\Foundation\Auth\Access\AuthorizesResources’ not found


The AuthorizesResources trait has been merged with the AuthorizesRequests trait. You should remove the AuthorizesResources trait from your app/Http/Controllers/Controller.php file if you have it there.


namespace App\Http\Controllers;


use Illuminate\Foundation\Bus\DispatchesJobs;

use Illuminate\Routing\Controller as BaseController;

use Illuminate\Foundation\Validation\ValidatesRequests;

use Illuminate\Foundation\Auth\Access\AuthorizesRequests;


class Controller extends BaseController


use AuthorizesRequests, DispatchesJobs, ValidatesRequests;


ErrorException (E_ERROR)

Route [xxxxxxxxxxxx] not defined.


If you are used prefix routing in the older Laravel, after upgraded to Laravel 5.5, when calling the prefix routing name in the view, we don’t need to include the prefix name in the route name.

Example: => page.index (Remove prefix dashboard)

I hope this piece of information helps.


Lim Socheat (

User Comments
Leave a Comment

© 2017 KayAdmin. All Rights Reserved | Built with KayAdmin