You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
619 B
PHP
26 lines
619 B
PHP
<?php
|
|
namespace App\Helper;
|
|
|
|
class JSONResponse {
|
|
static function Success($arr=[]) {
|
|
$arr["result"]="success";
|
|
return response()->json($arr);
|
|
}
|
|
static function Error($msg,$arr=[]) {
|
|
$arr["result"]="error";
|
|
$arr['message']=$msg;
|
|
return response()->json($arr);
|
|
}
|
|
static function Debug($data) {
|
|
return response()->json(["result"=>"debug", "data"=>$data]);
|
|
}
|
|
static function Unauthorized($arr=[]) {
|
|
$arr["result"]="unauthorized";
|
|
return response()->json($arr);
|
|
}
|
|
static function Forbidden($arr=[]) {
|
|
$arr["result"]="forbidden";
|
|
return response()->json($arr);
|
|
}
|
|
}
|