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: https://laravel.com/docs/5.5/upgrade
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.
Navigate to ROOT directory and open up the composer.json file and then update the following information.
"@php artisan package:discover"
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
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:
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.
use Illuminate\Routing\Controller as BaseController;
class Controller extends BaseController
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
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: dashboard.page.index => page.index (Remove prefix dashboard)
I hope this piece of information helps.
Lim Socheat (limsocheat.com)
© 2017 KayAdmin. All Rights Reserved | Built with KayAdmin