This commit is contained in:
freek 2018-12-03 12:12:53 +01:00
parent 6dfd723216
commit 121b818da1
2 changed files with 26 additions and 0 deletions

View File

@ -42,6 +42,11 @@ return [
*/
'max_request_size_in_kb' => 250,
/*
* This model will be used to store the statistics of the WebSocketsServer
*/
'statistics_model' => \BeyondCode\LaravelWebSockets\Statistics\WebSocketsStatisticsEntry::class,
/*
* Define the optional SSL context for your WebSocket connections.
* You can see all available options at: http://php.net/manual/en/context.ssl.php

View File

@ -0,0 +1,21 @@
<?php
namespace BeyondCode\LaravelWebSockets\Statistics\Http\Controllers;
use BeyondCode\LaravelWebSockets\Statistics\WebSocketsStatisticsEntry;
use Illuminate\Http\Request;
class WebsocketStatisticsEntriesController
{
public function store(Request $request)
{
$validatedAttributes = $request->validate([
'app_id' => 'required',
'peak_connections' => 'required|integer',
'websocket_message_count' => 'required|integer',
'api_message_count' => 'required|integer',
]);
WebSocketsStatisticsEntry::create($validatedAttributes);
}
}