hyperf-chat/app/Controller/IndexController.php

23 lines
484 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();
var_dump($this->request->all());
return [
'method' => $method,
'message' => "Hello {$user}.",
];
}
}