diff --git a/config/websockets.php b/config/websockets.php index 2f4ffb19a4..2d52a542d9 100644 --- a/config/websockets.php +++ b/config/websockets.php @@ -29,22 +29,6 @@ */ 'client_provider' => ConfigClientProvider::class, - 'dashboard' => [ - - /* - * Path for the Websockets debug dashboard - */ - 'path' => '/websockets', - - /* - * Middleware that will be applied to the dashboard routes. - */ - 'middleware' => [ - 'web', - Authorize::class, - ], - ], - /* * This array contains the hosts of which you want to allow incoming requests. * Leave this empty if you want to accepts requests from all hosts. diff --git a/src/Dashboard/Http/routes.php b/src/Dashboard/Http/routes.php deleted file mode 100644 index 99d0f6f54a..0000000000 --- a/src/Dashboard/Http/routes.php +++ /dev/null @@ -1,9 +0,0 @@ -publishes([ __DIR__.'/../config/websockets.php' => base_path('config/websockets.php'), ], 'config'); - $this->registerRoutes(); + $this->registerRouteMacro(); $this->registerDashboardGate(); @@ -33,21 +35,17 @@ public function boot() Event::subscribe(EventSubscriber::class); } - protected function registerRoutes() + protected function registerRouteMacro() { - Route::group($this->routeConfiguration(), function () { - $this->loadRoutesFrom(__DIR__.'/Dashboard/Http/routes.php'); + Route::macro('websocketsDashboard', function($prefix = 'websockets') { + Route::prefix($prefix)->namespace('\\')->middleware(Authorize::class)->group(function() { + Route::get('/', ShowDashboard::class); + Route::post('auth', AuthenticateDashboard::class); + Route::post('event', SendMessage::class); + }); }); } - protected function routeConfiguration() - { - return [ - 'prefix' => config('websockets.dashboard.path'), - 'middleware' => 'websockets', - ]; - } - public function register() { $this->mergeConfigFrom(__DIR__.'/../config/websockets.php', 'websockets');