send(); $response = array( "status" => "success" ); } catch (\Exception $e) { $response = array( "status" => "error", "error" => "{$e->getMessage()}" ); }; echo json_encode($response);