<?php
class Yz{
    public static function echo($data=[],$code=200){
        $result=array();
        $result['code']=$code;
        $result['data']=$data;
        return response()->json($result)->setEncodingOptions(JSON_UNESCAPED_UNICODE);
    }
    public static function echoError($msg){
        $result=array();
        $result['status']='no';
        $result['msg']=$msg;
        return response()->json($result)->setEncodingOptions(JSON_UNESCAPED_UNICODE);
    }
    public static function echoError1($msg){
        $result=array();
        $result['status']=false;
        $result['msg']=$msg;
        return response()->json($result)->setEncodingOptions(JSON_UNESCAPED_UNICODE);
    }

    public static function Return($status,$msg,$data=[]){
        $result=array();
        $result['status']=$status;
        $result['msg']=$msg;
        $result['data']=$data;
        return $result;
    }
}

