Merge branch 'master' of github.com:beyondcode/laravel-websockets
This commit is contained in:
commit
0641dd6bdf
|
|
@ -4,7 +4,11 @@ namespace BeyondCode\LaravelWebSockets\Server;
|
||||||
|
|
||||||
use BeyondCode\LaravelWebSockets\LaravelEcho;
|
use BeyondCode\LaravelWebSockets\LaravelEcho;
|
||||||
use BeyondCode\LaravelWebSockets\Server\Logger\MessageLogger;
|
use BeyondCode\LaravelWebSockets\Server\Logger\MessageLogger;
|
||||||
use BeyondCode\LaravelWebSockets\Server\WebSocketController;
|
use BeyondCode\LaravelWebSockets\WebSocketServer\Controllers\FetchChannel;
|
||||||
|
use BeyondCode\LaravelWebSockets\WebSocketServer\Controllers\FetchChannels;
|
||||||
|
use BeyondCode\LaravelWebSockets\WebSocketServer\Controllers\FetchUsers;
|
||||||
|
use BeyondCode\LaravelWebSockets\WebSocketServer\Controllers\TriggerEvent;
|
||||||
|
use BeyondCode\LaravelWebSockets\WebSocketServer\Pusher\PusherController;
|
||||||
use Ratchet\WebSocket\WsServer;
|
use Ratchet\WebSocket\WsServer;
|
||||||
use Symfony\Component\Routing\Route;
|
use Symfony\Component\Routing\Route;
|
||||||
use Ratchet\Http\HttpServerInterface;
|
use Ratchet\Http\HttpServerInterface;
|
||||||
|
|
@ -67,13 +71,13 @@ class Router
|
||||||
|
|
||||||
public function echo()
|
public function echo()
|
||||||
{
|
{
|
||||||
$this->get('/app/{appKey}', LaravelEcho\Pusher\PusherServer::class);
|
$this->get('/app/{appKey}', PusherController::class);
|
||||||
|
|
||||||
$this->get('/apps/{appId}/channels', LaravelEcho\Http\Controllers\FetchChannels::class);
|
$this->get('/apps/{appId}/channels', FetchChannels::class);
|
||||||
$this->get('/apps/{appId}/channels/{channelName}', LaravelEcho\Http\Controllers\FetchChannel::class);
|
$this->get('/apps/{appId}/channels/{channelName}', FetchChannel::class);
|
||||||
$this->get('/apps/{appId}/channels/{channelName}/users', LaravelEcho\Http\Controllers\FetchUsers::class);
|
$this->get('/apps/{appId}/channels/{channelName}/users', FetchUsers::class);
|
||||||
|
|
||||||
$this->post('/apps/{appId}/events', LaravelEcho\Http\Controllers\TriggerEvent::class);
|
$this->post('/apps/{appId}/events', TriggerEvent::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||||
use Symfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory;
|
use Symfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory;
|
||||||
use BeyondCode\LaravelWebSockets\WebSocketServer\Pusher\Channels\ChannelManager;
|
use BeyondCode\LaravelWebSockets\WebSocketServer\Pusher\Channels\ChannelManager;
|
||||||
|
|
||||||
abstract class EchoController implements HttpServerInterface
|
abstract class Controller implements HttpServerInterface
|
||||||
{
|
{
|
||||||
/** @var \BeyondCode\LaravelWebSockets\WebSocketServer\Pusher\Channels\ChannelManager */
|
/** @var \BeyondCode\LaravelWebSockets\WebSocketServer\Pusher\Channels\ChannelManager */
|
||||||
protected $channelManager;
|
protected $channelManager;
|
||||||
|
|
@ -5,7 +5,7 @@ namespace BeyondCode\LaravelWebSockets\WebSocketServer\Controllers;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||||
|
|
||||||
class FetchChannel extends EchoController
|
class FetchChannel extends Controller
|
||||||
{
|
{
|
||||||
public function __invoke(Request $request)
|
public function __invoke(Request $request)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use BeyondCode\LaravelWebSockets\WebSocketServer\Pusher\Channels\PresenceChannel;
|
use BeyondCode\LaravelWebSockets\WebSocketServer\Pusher\Channels\PresenceChannel;
|
||||||
|
|
||||||
class FetchChannels extends EchoController
|
class FetchChannels extends Controller
|
||||||
{
|
{
|
||||||
public function __invoke(Request $request)
|
public function __invoke(Request $request)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ use Illuminate\Support\Collection;
|
||||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||||
use BeyondCode\LaravelWebSockets\WebSocketServer\Pusher\Channels\PresenceChannel;
|
use BeyondCode\LaravelWebSockets\WebSocketServer\Pusher\Channels\PresenceChannel;
|
||||||
|
|
||||||
class FetchUsers extends EchoController
|
class FetchUsers extends Controller
|
||||||
{
|
{
|
||||||
public function __invoke(Request $request)
|
public function __invoke(Request $request)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ namespace BeyondCode\LaravelWebSockets\WebSocketServer\Controllers;
|
||||||
use BeyondCode\LaravelWebSockets\Events\ApiMessageSent;
|
use BeyondCode\LaravelWebSockets\Events\ApiMessageSent;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
class TriggerEvent extends EchoController
|
class TriggerEvent extends Controller
|
||||||
{
|
{
|
||||||
public function __invoke(Request $request)
|
public function __invoke(Request $request)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue