Merge pull request #671 from mahansky/2.x

[2.x] Customize dashboard domain and path using env vars
This commit is contained in:
rennokki 2021-01-23 16:44:33 +02:00 committed by GitHub
commit a84f143087
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -15,7 +15,9 @@ return [
'port' => env('LARAVEL_WEBSOCKETS_PORT', 6001), 'port' => env('LARAVEL_WEBSOCKETS_PORT', 6001),
'path' => 'laravel-websockets', 'domain' => env('LARAVEL_WEBSOCKETS_DOMAIN'),
'path' => env('LARAVEL_WEBSOCKETS_PATH', 'laravel-websockets'),
'middleware' => [ 'middleware' => [
'web', 'web',
@ -71,7 +73,7 @@ return [
'enable_client_messages' => false, 'enable_client_messages' => false,
'enable_statistics' => true, 'enable_statistics' => true,
'allowed_origins' => [ 'allowed_origins' => [
// // env('LARAVEL_WEBSOCKETS_DOMAIN'),
], ],
], ],
], ],

View File

@ -155,6 +155,7 @@ class WebSocketsServiceProvider extends ServiceProvider
protected function registerDashboardRoutes() protected function registerDashboardRoutes()
{ {
Route::group([ Route::group([
'domain' => config('websockets.dashboard.domain'),
'prefix' => config('websockets.dashboard.path'), 'prefix' => config('websockets.dashboard.path'),
'as' => 'laravel-websockets.', 'as' => 'laravel-websockets.',
'middleware' => config('websockets.dashboard.middleware', [AuthorizeDashboard::class]), 'middleware' => config('websockets.dashboard.middleware', [AuthorizeDashboard::class]),