<?php

namespace App\Http\Controllers;

use App\SysxUser;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use JWTAuth;
use Tymon\JWTAuth\Exceptions\JWTException;

class ResponseController extends Controller
{

    public function successResponse($code = 200, $data, $message = 'Data Sukses Didapat')
    {
        return response()->json([
            'status' => $code,
            'data' => $data,
            'message' => $message
        ],$code);
    }
    public function errorResponse($code = 404, $data = null, $message = 'Data Gagal Didapat')
    {
        return response()->json([
            'status' => $code,
            'data' => $data,
            'message' => $message
        ],$code);
    }
}
