*/ protected $dontFlash = [ 'current_password', 'password', 'password_confirmation', ]; /** * Register the exception handling callbacks for the application. */ public function register(): void { $this->reportable(function (Throwable $e) { // }); $this->renderable(function (MethodNotAllowedHttpException $e, $request){ $respuesta = json_encode([ "error" => true, "msg" => "ERR_GLB_USU000: Método no soportado.", "response" => [] ]); return response($respuesta, 405)->header('Content-Type', 'application/json'); }); $this->renderable(function (NotFoundHttpException $e, $request){ $respuesta = json_encode([ "error" => true, "msg" => "ERR_GLB_USU001: La ruta solicitada no existe: " . $request->fullUrl(), "response" => [] ]); return response($respuesta, 404)->header('Content-Type', 'application/json'); }); $this->renderable(function (QueryException $e, $request){ $respuesta = json_encode([ "error" => true, //"msg" => "ERR_GLB_USU002: No se pudo establecer una conexión con la base de datos. Código de error: " . $e->getCode(), "msg" => "ERR_GLB_USU002: No se pudo establecer una conexión con la base de datos. Código de error: " . $e->getMessage(), "response" => [] ]); return response($respuesta, 500)->header('Content-Type', 'application/json'); }); } }