Добрый день
Вот мои файлы
Часть из composer.json
"require": {
...
"pusher/pusher-php-server": "^4.0",
...
},
.env
BROADCAST_DRIVER=redis
CACHE_DRIVER=file
QUEUE_CONNECTION=redis
SESSION_DRIVER=database
SESSION_LIFETIME=240
REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379
вызов event
event(new App\Events\TestEvent('testMessage'));
Событие App\Events\TestEvent
<?php
namespace App\Events;
use Illuminate\Broadcasting\Channel;
use Illuminate\Queue\SerializesModels;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
class TestEvent implements ShouldBroadcast
{
use Dispatchable, InteractsWithSockets, SerializesModels;
public $message;
public function __construct($message)
{
$this->message = $message;
}
public function broadcastOn()
{
return new Channel('testEvent');
}
}
Illuminate\Broadcasting\BroadcastManager
namespace Illuminate\Broadcasting;
use Closure;
use Pusher\Pusher;
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;
/**
* @mixin \Illuminate\Contracts\Broadcasting\Broadcaster
*/
class BroadcastManager implements FactoryContract
{
...
protected function createPusherDriver(array $config)
{
$pusher = new Pusher( /*line:211*/
$config['key'], $config['secret'],
$config['app_id'], $config['options'] ?? []
);
if ($config['log'] ?? false) {
$pusher->setLogger($this->app->make(LoggerInterface::class));
}
return new PusherBroadcaster($pusher);
}
...
Вопрос заключается в том, что я делаю не так? Почему ругается, что отсутствует класс Pusher\Pusher?
Я установил pusher/pusher-php-server, но всё равно получаю туже самую ошибку
.ERROR: Class 'Pusher\Pusher' not found {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\FatalThrowableError(code: 0): Class 'Pusher\\Pusher' not found at .../app/vendor/laravel/framework/src/Illuminate/Broadcasting/BroadcastManager.php:211)