hyperf-chat/app/Controller/IndexController.php

31 lines
647 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
/**
* This file is part of Hyperf.
*
* @link https://www.hyperf.io
* @document https://hyperf.wiki
* @contact group@hyperf.io
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
*/
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)
{
$user = $this->request->input('user', 'Hyperf');
$method = $this->request->getMethod();
return [
'method' => $method,
2020-11-04 11:57:16 +08:00
'message' => "Hello {$user}.",
2020-11-02 22:45:37 +08:00
];
}
}