Add response for JSON only
This commit is contained in:
@@ -221,6 +221,16 @@ class ApiResponse extends Response
|
||||
$this->addContent($return);
|
||||
}
|
||||
|
||||
/**
|
||||
* Wrapper around exit() for JSON only responses
|
||||
*
|
||||
* @param array $data
|
||||
*/
|
||||
public function exitWithJson(array $data)
|
||||
{
|
||||
$this->exit('content', ['content' => $data], static::TYPE_JSON);
|
||||
}
|
||||
|
||||
/**
|
||||
* Quit execution with the message that the endpoint isn't implemented
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user