| Package Data | |
|---|---|
| Maintainer Username: | matthew.erskine |
| Maintainer Contact: | matthew@erskine.com (Matthew Erskine) |
| Package Create Date: | 2018-05-25 |
| Package Last Update: | 2018-05-25 |
| Language: | PHP |
| License: | MIT |
| Last Refreshed: | 2025-10-19 15:16:54 |
| Package Statistics | |
|---|---|
| Total Downloads: | 504 |
| Monthly Downloads: | 4 |
| Daily Downloads: | 0 |
| Total Stars: | 1 |
| Total Watchers: | 1 |
| Total Forks: | 1 |
| Total Open Issues: | 0 |
This is a simple package which provides a static helper class for generating errors suitable to quickly render as JSON.
To use in Laravel/Lumen applications:
in app/Exceptions/Handler.php:
use MatthewErskine\JsonErrorRenderer\JsonErrorRenderer;
public function render($request, Exception $e)
{
$error = JsonErrorRenderer::render($request, $e);
return response()->json(
$error->getPayload(),
$error->getStatusCode()
);
}