wip
This commit is contained in:
parent
10749db211
commit
6e4621cf77
|
|
@ -13,9 +13,18 @@ use Ratchet\Http\HttpServerInterface;
|
||||||
use Psr\Http\Message\RequestInterface;
|
use Psr\Http\Message\RequestInterface;
|
||||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||||
use Symfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory;
|
use Symfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory;
|
||||||
|
use BeyondCode\LaravelWebSockets\LaravelEcho\Pusher\Channels\ChannelManager;
|
||||||
|
|
||||||
abstract class EchoController implements HttpServerInterface
|
abstract class EchoController implements HttpServerInterface
|
||||||
{
|
{
|
||||||
|
/** @var \BeyondCode\LaravelWebSockets\LaravelEcho\Pusher\Channels\ChannelManager */
|
||||||
|
protected $channelManager;
|
||||||
|
|
||||||
|
public function __construct(ChannelManager $channelManager)
|
||||||
|
{
|
||||||
|
$this->channelManager = $channelManager;
|
||||||
|
}
|
||||||
|
|
||||||
public function onOpen(ConnectionInterface $connection, RequestInterface $request = null)
|
public function onOpen(ConnectionInterface $connection, RequestInterface $request = null)
|
||||||
{
|
{
|
||||||
$queryParameters = [];
|
$queryParameters = [];
|
||||||
|
|
|
||||||
|
|
@ -9,14 +9,6 @@ use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||||
|
|
||||||
class FetchChannel extends EchoController
|
class FetchChannel extends EchoController
|
||||||
{
|
{
|
||||||
/** @var \BeyondCode\LaravelWebSockets\LaravelEcho\Pusher\Channels\ChannelManager */
|
|
||||||
protected $channelManager;
|
|
||||||
|
|
||||||
public function __construct(ChannelManager $channelManager)
|
|
||||||
{
|
|
||||||
$this->channelManager = $channelManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function __invoke(Request $request)
|
public function __invoke(Request $request)
|
||||||
{
|
{
|
||||||
$channel = $this->channelManager->find($request->appId, $request->channelName);
|
$channel = $this->channelManager->find($request->appId, $request->channelName);
|
||||||
|
|
|
||||||
|
|
@ -11,14 +11,6 @@ use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||||
|
|
||||||
class FetchChannels extends EchoController
|
class FetchChannels extends EchoController
|
||||||
{
|
{
|
||||||
/** @var \BeyondCode\LaravelWebSockets\LaravelEcho\Pusher\Channels\ChannelManager */
|
|
||||||
protected $channelManager;
|
|
||||||
|
|
||||||
public function __construct(ChannelManager $channelManager)
|
|
||||||
{
|
|
||||||
$this->channelManager = $channelManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function __invoke(Request $request)
|
public function __invoke(Request $request)
|
||||||
{
|
{
|
||||||
$channels = Collection::make($this->channelManager->getChannels($request->appId))->filter(function ($channel) {
|
$channels = Collection::make($this->channelManager->getChannels($request->appId))->filter(function ($channel) {
|
||||||
|
|
|
||||||
|
|
@ -11,14 +11,6 @@ use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||||
|
|
||||||
class FetchUsers extends EchoController
|
class FetchUsers extends EchoController
|
||||||
{
|
{
|
||||||
/** @var \BeyondCode\LaravelWebSockets\LaravelEcho\Pusher\Channels\ChannelManager */
|
|
||||||
protected $channelManager;
|
|
||||||
|
|
||||||
public function __construct(ChannelManager $channelManager)
|
|
||||||
{
|
|
||||||
$this->channelManager = $channelManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function __invoke(Request $request)
|
public function __invoke(Request $request)
|
||||||
{
|
{
|
||||||
$channel = $this->channelManager->find($request->appId, $request->channelName);
|
$channel = $this->channelManager->find($request->appId, $request->channelName);
|
||||||
|
|
|
||||||
|
|
@ -4,18 +4,9 @@ namespace BeyondCode\LaravelWebSockets\LaravelEcho\Http\Controllers;
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||||
use BeyondCode\LaravelWebSockets\LaravelEcho\Pusher\Channels\ChannelManager;
|
|
||||||
|
|
||||||
class TriggerEvent extends EchoController
|
class TriggerEvent extends EchoController
|
||||||
{
|
{
|
||||||
/** @var \BeyondCode\LaravelWebSockets\LaravelEcho\Pusher\Channels\ChannelManager */
|
|
||||||
protected $channelManager;
|
|
||||||
|
|
||||||
public function __construct(ChannelManager $channelManager)
|
|
||||||
{
|
|
||||||
$this->channelManager = $channelManager;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function __invoke(Request $request)
|
public function __invoke(Request $request)
|
||||||
{
|
{
|
||||||
$this->verifySignature($request);
|
$this->verifySignature($request);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue