Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Prullenbak's avatar

Upgrading to Laravel 5.2: undefined method Illuminate\Bus\Dispatcher

I followed the upgrade guide to update an app from 5.1 to 5.2, but I get the error

Call to undefined method Illuminate\Bus\Dispatcher::mapUsing() in app/Providers/BusServiceProvider.php on line 16

I know the bus-stuff was mostly removed from laravel and moved to a package, but this shouldn't break my whole app and artisan, right?

What am I missing here?

0 likes
6 replies
Prullenbak's avatar

Yes, I know. It says so in the upgrade guide: "If you would like to continue using separate commands and handlers, you may install a Laravel Collective package..." But that's the thing. What if you would like to continue without these seperate handlers? I had one command, I can change that to be self handling, no problem.

I now found that deleting app/providers/BusServiceProvider.php and removing that line from config/app.php, and THEN changing the app/http/controller/controller.php to the one on github, seems to fix the problem. But it's strange that I seem to be the only one with this problem, and the upgrade guide says nothing more about this.

joedawson's avatar

Wasn't trying to provide answer, just giving my two cents :) - hope you get it sorted.

Prullenbak's avatar

Your answer would've been great, if I wanted to use separate handlers and keep using the bus. But I don't :P

Anyway, It seems to be working now, but I wonder if I did this correctly...

orrd's avatar

I had to do the same thing. I had to delete and "app/Providers/BusServiceProvider.php". And then in app.php remove 'Illuminate\Bus\BusServiceProvider', 'App\Providers\BusServiceProvider'. I also deleted "app/Providers/ConfigServiceProvider.php" since that's no longer used either. I didn't have to modify my app/http/controller/controller.php.

I don't know how other people are able to get the upgrade to work without doing that, but I'm pretty sure the upgrade docs should mention that.

3 likes

Please or to participate in this conversation.