mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-06-13 12:52:41 +01:00
25 lines
469 B
PHP
25 lines
469 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Exceptions;
|
|
|
|
use Exception;
|
|
use Illuminate\Http\JsonResponse;
|
|
use Illuminate\Http\Request;
|
|
|
|
class ApiException extends Exception
|
|
{
|
|
/**
|
|
* Render the exception into an HTTP response.
|
|
*/
|
|
public function render(Request $request): JsonResponse
|
|
{
|
|
return response()
|
|
->json([
|
|
'error' => true,
|
|
'message' => $this->getMessage(),
|
|
], 400);
|
|
}
|
|
}
|