Yab\Quarx\Services\QuarxResponseService::apiResponse PHP Method

apiResponse() public static method

Generate an api response.
public static apiResponse ( string $type, string $message, $code = 200 ) : Illuminate\Support\Facades\Response
$type string Response type
$message string Response string
return Illuminate\Support\Facades\Response
    public static function apiResponse($type, $message, $code = 200)
    {
        return Response::json(['status' => $type, 'data' => $message], $code);
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Store a newly created Images in storage.
  *
  * @param ImagesRequest $request
  *
  * @return Response
  */
 public function apiStore(Request $request)
 {
     $image = $this->imagesRepository->apiStore($request->all());
     $image->location = FileService::fileAsPublicAsset($image->location);
     return QuarxResponseService::apiResponse('success', $image);
 }
All Usage Examples Of Yab\Quarx\Services\QuarxResponseService::apiResponse