Redis service
This commit is contained in:
@ -5,7 +5,7 @@ use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
trait withJson
|
||||
{
|
||||
public function withJson(ResponseInterface $response, array $data = []): ResponseInterface
|
||||
public function withJson(ResponseInterface $response, array|object $data = []): ResponseInterface
|
||||
{
|
||||
$response->getBody()->write(json_encode($data));
|
||||
return $response->withHeader('Content-Type', 'application/json');
|
||||
|
Reference in New Issue
Block a user