Class 'Pusher' not found

Viewed 19523

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

6 Answers

Use this command and install pusher. It worked for me in Laravel and PHP 8.0.8 perfectly without any additions of code changes.

composer require pusher/pusher-php-server

It's worth checking the version of Pusher used in composer.json. At this moment if you got stuck with implementing Pusher in Laravel 8 or 9 then your pusher-php-server version should be close to 7. At this moment the version of pusher is 7.1.0 (beta)* and therefore you should change composer.json entry to

"pusher/pusher-php-server": "^7.0",

Just go to vendor/laravel/framework/src/Illuminate/Broadcasting/Broadcasters/PusherBroadcaster.php and change "Use Pusher" to "Use Pusher/Pusher";

Related