<?php
namespace Root\Core\Helper;

use Illuminate\Http\JsonResponse;

class Response
{
    public static function success(mixed $data = [], string $message = 'OK', int $code = 200): JsonResponse
    {
        return response()->json(['status' => true, 'message' => $message, 'data' => $data], $code);
    }

    public static function error(string $message, int $code = 400): JsonResponse
    {
        return response()->json(['status' => false, 'message' => $message], $code);
    }
}
