Class 'Pusher' not found

user8294451 picture user8294451 · Jul 12, 2017 · Viewed 13.2k times · Source

When I install Pusher package, I got an error "Class 'Pusher' not found".

Answer

Larry Reinhard picture Larry Reinhard · Jul 29, 2017

Claudio's diagnosis is correct, the namespace Pusher was added in version 3; but changing the Laravel files is not a recommended solution.

A better way is to create an alias in config/app.php. Under the 'aliases' key, add this to the array in the "Third Party Aliases" section:

'Pusher' => Pusher\Pusher::class,