wip
This commit is contained in:
parent
e993457a80
commit
4aab3d441f
|
|
@ -56,6 +56,11 @@ return [
|
|||
'interval_in_seconds' => 60,
|
||||
],
|
||||
|
||||
/*
|
||||
* This path will be used to register the necessary routes for the package.
|
||||
*/
|
||||
'path' => 'laravel-websockets',
|
||||
|
||||
/*
|
||||
* Define the optional SSL context for your WebSocket connections.
|
||||
* You can see all available options at: http://php.net/manual/en/context.ssl.php
|
||||
|
|
|
|||
|
|
@ -32,8 +32,7 @@ class WebSocketsServiceProvider extends ServiceProvider
|
|||
}
|
||||
|
||||
$this
|
||||
->registerRouteMacro()
|
||||
->registerStatisticRoute()
|
||||
->registerRoutes()
|
||||
->registerDashboardGate();
|
||||
|
||||
$this->loadViewsFrom(__DIR__ . '/../resources/views/', 'websockets');
|
||||
|
|
@ -60,23 +59,14 @@ class WebSocketsServiceProvider extends ServiceProvider
|
|||
});
|
||||
}
|
||||
|
||||
protected function registerRouteMacro()
|
||||
protected function registerRoutes()
|
||||
{
|
||||
Route::macro('webSockets', function ($prefix = 'laravel-websockets') {
|
||||
Route::prefix($prefix)->namespace('\\')->middleware(Authorize::class)->group(function () {
|
||||
Route::get('/', ShowDashboard::class);
|
||||
Route::get('/api/{appId}/statistics', DashboardApiController::class . '@getStatistics');
|
||||
Route::post('auth', AuthenticateDashboard::class);
|
||||
Route::post('event', SendMessage::class);
|
||||
});
|
||||
});
|
||||
Route::prefix(config('websockets.path'))->middleware(Authorize::class)->group(function () {
|
||||
Route::get('/', ShowDashboard::class);
|
||||
Route::get('/api/{appId}/statistics', [DashboardApiController::class, 'getStatistics']);
|
||||
Route::post('auth', AuthenticateDashboard::class);
|
||||
Route::post('event', SendMessage::class);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
protected function registerStatisticRoute()
|
||||
{
|
||||
Route::prefix('/laravel-websockets')->namespace('\\')->group(function () {
|
||||
Route::post('statistics', [WebSocketStatisticsEntriesController::class, 'store']);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -29,11 +29,6 @@ abstract class TestCase extends \Orchestra\Testbench\TestCase
|
|||
|
||||
$this->channelManager = app(ChannelManager::class);
|
||||
|
||||
/** TODO: make this work without middleware prefix */
|
||||
Route::middleware('App\Http\Controllers')->group(function() {
|
||||
Route::webSockets();
|
||||
});
|
||||
|
||||
StatisticsLogger::fake();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue