Error Handling en Laravel 8
En Laravel 8 cambio la forma, se debe hacer dentro del metodo register(). Aqui se muestra como se debe implementar: https://laravel.com/docs/8.x/errors#rendering-exceptions
$this->renderable(function (NotFoundHttpException $e, $request) {
if ($request->is('api/*')) {
return response()->json([
'status' => 404,
'message' => 'record not found'
], 404);
}
});
