Support the ongoing development of Laravel.io →
posted 8 years ago
Installation

After updating to 5.4, I got this error in Terminal:

Generating autoload files
> Illuminate\Foundation\ComposerScripts::postUpdate
> php artisan optimize

                                                                   
[Symfony\Component\Debug\Exception\FatalErrorException]              
Call to undefined method Illuminate\Foundation\Application::share()  
                                                                   

Script php artisan optimize handling the post-update-cmd event returned with error code 255

Then when I load in a browser, I see:

FatalErrorException in BrowserDetectService.php line 48:
Call to undefined method Illuminate\Foundation\Application::share()

I did a fresh install on another server. And it worked fine but I don't see any difference in post-update-cmd in my composer.json file.

What does this error mean? I've looked online but not finding anything about this exact error.

Last updated 3 years ago.
0

Exact same problem here when trying to update from L5.3. Anyone found a solution yet?

I've tried deleting the vendor folder but that doesn't work either.

0

In the end I removed all the components in the "require" part of my composer.json file except for the main ones and then I added in the latest versions of all the packages I needed. This seemed to work.

Just need to comment any extra packages out in config/app.php while you do it

0

Do you use the laravelcollective/html package? It isn't updated to the new laravel version

0

Sign in to participate in this thread!

Eventy

Your banner here too?

jerauf jerauf Joined 16 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.