laravel-websockets/src/Console/RestartWebSocketServer.php

39 lines
807 B
PHP
Raw Normal View History

<?php
namespace BeyondCode\LaravelWebSockets\Console;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\InteractsWithTime;
class RestartWebSocketServer extends Command
{
use InteractsWithTime;
2020-08-18 17:21:22 +00:00
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'websockets:restart';
2020-08-18 17:21:22 +00:00
/**
* The console command description.
*
* @var string|null
*/
protected $description = 'Restart the Laravel WebSocket Server';
2020-08-18 17:21:22 +00:00
/**
* Run the command.
*
* @return void
*/
public function handle()
{
Cache::forever('beyondcode:websockets:restart', $this->currentTime());
$this->info('Broadcasting WebSocket server restart signal.');
}
}