<?php
class Response {
    public static function success($data = [], $code = 200) {
        http_response_code($code);
        echo json_encode(array_merge(['success' => true], $data));
        exit;
    }

    public static function error($message = 'An error occurred', $code = 500) {
        http_response_code($code);
        echo json_encode(['success' => false, 'error' => $message]);
        exit;
    }
}
