hyperf-chat/app/Controller/IndexController.php

21 lines
442 B
PHP
Raw Normal View History

2020-11-02 22:45:37 +08:00
<?php
declare(strict_types=1);
2020-11-04 11:57:16 +08:00
2020-11-02 22:45:37 +08:00
namespace App\Controller;
use Hyperf\HttpServer\Contract\ResponseInterface;
2020-11-03 14:07:54 +08:00
2020-11-02 22:45:37 +08:00
class IndexController extends AbstractController
{
public function index(ResponseInterface $response)
{
2021-04-20 16:30:57 +08:00
$user = $this->request->input('user', 'Hyperf');
2020-11-02 22:45:37 +08:00
$method = $this->request->getMethod();
return [
2021-04-20 16:30:57 +08:00
'method' => $method,
2020-11-04 11:57:16 +08:00
'message' => "Hello {$user}.",
2020-11-02 22:45:37 +08:00
];
}
}