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

vandyczech's avatar

Laravel 5.8 Pusher not found

I have problem with run Pusher ... I see error

Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR)
Class 'Pusher\Pusher' not found
…/vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastManager.php212

composer.json

 "require": {
         "pusher/pusher-php-server": "^3.0"
    },

in config.app I have uncommented

 'Broadcast' => Illuminate\Support\Facades\Broadcast::class,

and add alias for Pusher

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

But still not works ://////////////////

0 likes
10 replies
Snapey's avatar

You say you changed composer.json

Did you then run composer install?

You should not need it, but its always worth trying composer dump-autoload

vandyczech's avatar

@Snapey Only help is BROADCAST_DRIVER=log no BROADCAST_DRIVER=pusher but now i test if this is solution is right ... what i set to pusher i see the same eror pusher not found

Snapey's avatar

Did you then run composer install?

Snapey's avatar

So when you ran composer install, you saw it download the pusher library and its dependencies, and there was no errors?

And composer dump makes no difference?

Look in vendor folder. Do you see pusher/pusher-php-server folder?

vandyczech's avatar

@Snapey

Using version ^3.4 for pusher/pusher-php-server
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Installing pusher/pusher-php-server (v3.4.1): Loading from cache
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: beyondcode/laravel-dump-server
Discovered Package: fideloper/proxy
Discovered Package: laravel/tinker
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Package manifest generated successfully.

vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastManager.php
Class 'Pusher\Pusher' not found

I use these

namespace Illuminate\Broadcasting;

use Closure;
use Psr\Log\LoggerInterface;
use InvalidArgumentException;
use Illuminate\Broadcasting\Broadcasters\LogBroadcaster;
use Illuminate\Broadcasting\Broadcasters\NullBroadcaster;
use Illuminate\Contracts\Broadcasting\ShouldBroadcastNow;
use Illuminate\Broadcasting\Broadcasters\RedisBroadcaster;
use Illuminate\Broadcasting\Broadcasters\PusherBroadcaster;
use Illuminate\Contracts\Broadcasting\Factory as FactoryContract;
use Pusher\Pusher;
use Pusher\Webhook;

from BroadcastManager.php

protected function createPusherDriver(array $config)
    {
        $pusher = new Pusher(
            $config['key'], $config['secret'],
            $config['app_id'], $config['options'] ?? []
        );
 
        if ($config['log'] ?? false) {
            $pusher->setLogger($this->app->make(LoggerInterface::class));
        }
 
        return new PusherBroadcaster($pusher);
    }
Etty's avatar

I have the same problem. Have you got a solution?

m-nobre's avatar

If you're having this problem in 2020, here's how I solved mine.

First updating composer, was putting off the message saying a new version (2.0) was available. As I am in windows, control panel, uninstall composer and installed newer version.

Set my composer JSON file to the original (before I started to meddle with it)

Deleted the composer lock file as guzzle was locked to an old version

Deleted my Vendor folder

Composer install

Everything worked like a charm straight away.

Good luck!

1 like
tinkerbell's avatar

If you are still facing this in 2021 in my case, adding

BROADCAST_DRIVER=radis


//in .env file 

fixed my problem happy coding :)

Please or to participate in this conversation.