hyperf-chat/app/Controller/IndexController.php

21 lines
442 B
PHP

<?php
declare(strict_types=1);
namespace App\Controller;
use Hyperf\HttpServer\Contract\ResponseInterface;
class IndexController extends AbstractController
{
public function index(ResponseInterface $response)
{
$user = $this->request->input('user', 'Hyperf');
$method = $this->request->getMethod();
return [
'method' => $method,
'message' => "Hello {$user}.",
];
}
}