diff --git a/resources/views/dashboard.blade.php b/resources/views/dashboard.blade.php index 88269b7..bb4b5a3 100644 --- a/resources/views/dashboard.blade.php +++ b/resources/views/dashboard.blade.php @@ -106,7 +106,7 @@ wsHost: window.location.hostname, wsPort: this.port, disableStats: true, - authEndpoint: '{{ config('websockets.dashboard.path') }}/auth', + authEndpoint: '/{{ request()->path() }}/auth', auth: { headers: { 'X-CSRF-Token': "{{ csrf_token() }}" @@ -171,7 +171,7 @@ }, sendEvent() { - $.post('{{ config('websockets.dashboard.path') }}/event', { + $.post('/{{ request()->path() }}/event', { _token: '{{ csrf_token() }}', key: this.client.appKey, secret: this.client.appSecret, diff --git a/src/WebSocketsServiceProvider.php b/src/WebSocketsServiceProvider.php index a9d6922..bd0f27d 100644 --- a/src/WebSocketsServiceProvider.php +++ b/src/WebSocketsServiceProvider.php @@ -54,7 +54,7 @@ class WebSocketsServiceProvider extends ServiceProvider protected function registerRouteMacro() { - Route::macro('websocketsDashboard', function($prefix = 'websockets') { + Route::macro('webSocketsDashboard', function($prefix = 'websockets') { Route::prefix($prefix)->namespace('\\')->middleware(Authorize::class)->group(function() { Route::get('/', ShowDashboard::class); Route::post('auth', AuthenticateDashboard::class);