wip
This commit is contained in:
parent
f8008ea95e
commit
e6b22dc36f
|
|
@ -30,10 +30,6 @@ class ChannelManager
|
|||
|
||||
protected function detectChannelClass($channelId): string
|
||||
{
|
||||
if (starts_with($channelId, 'logging-')) {
|
||||
return LoggingChannel::class;
|
||||
}
|
||||
|
||||
if (starts_with($channelId, 'private-')) {
|
||||
return PrivateChannel::class;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,24 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace BeyondCode\LaravelWebSockets\LaravelEcho\Pusher\Channels;
|
||||
|
||||
use BeyondCode\LaravelWebSockets\LaravelEcho\Pusher\Exceptions\InvalidConnectionException;
|
||||
use stdClass;
|
||||
use Ratchet\ConnectionInterface;
|
||||
|
||||
class LoggingChannel extends Channel
|
||||
{
|
||||
public function subscribe(ConnectionInterface $connection, stdClass $payload)
|
||||
{
|
||||
$this->verifySignature($connection, $payload);
|
||||
|
||||
$this->verifyAdministrator($connection);
|
||||
|
||||
parent::subscribe($connection, $payload);
|
||||
}
|
||||
|
||||
protected function verifyAdministrator(ConnectionInterface $connection)
|
||||
{
|
||||
throw_unless($connection->isAdmin, new InvalidConnectionException());
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue