mirror of
https://github.com/bitinflow/expose.git
synced 2026-03-13 21:45:55 +00:00
38 lines
904 B
PHP
38 lines
904 B
PHP
<?php
|
|
|
|
namespace App\Server\Http\Controllers\Admin;
|
|
|
|
use App\Contracts\LoggerRepository;
|
|
use App\Server\Configuration;
|
|
use Illuminate\Http\Request;
|
|
use Ratchet\ConnectionInterface;
|
|
|
|
class GetLogsController extends AdminController
|
|
{
|
|
protected $keepConnectionOpen = true;
|
|
|
|
/** @var Configuration */
|
|
protected $configuration;
|
|
|
|
/** @var LoggerRepository */
|
|
protected $logger;
|
|
|
|
public function __construct(LoggerRepository $logger)
|
|
{
|
|
$this->logger = $logger;
|
|
}
|
|
|
|
public function handle(Request $request, ConnectionInterface $httpConnection)
|
|
{
|
|
$subdomain = $request->get('subdomain');
|
|
$this->logger->getLogs()
|
|
->then(function ($logs) use ($httpConnection) {
|
|
$httpConnection->send(
|
|
respond_json(['logs' => $logs])
|
|
);
|
|
|
|
$httpConnection->close();
|
|
});
|
|
}
|
|
}
|