src/Http/Responds.php
public function respondCreated($code = ApiResponse::CODE_SUCCESS, array $data = [], $message = null): JsonResponse
    {
        return $this->setStatusCode(IlluminateResponse::HTTP_CREATED)->respond([
            'status' => [
                'type' => 'success',
                'message' => $this->getDefaultMessage($code, $message),
                'code' => $code,
                'http_code' => $this->getStatusCode(),
            ],
            'data' => $data,
        ]);
    }
public function respondCreated($code = ApiResponse::CODE_SUCCESS, array $data = [], $message = null): JsonResponse
    {
        return $this->setStatusCode(IlluminateResponse::HTTP_CREATED)->respond([
            'status' => [
                'type' => 'success',
                'message' => $this->getDefaultMessage($code, $message),
                'code' => $code,
                'http_code' => $this->getStatusCode(),
            ],
            'data' => $data,
        ]);
    }
public function respondCreated ( $ code = ApiResponse :: CODE_SUCCESS , array $ data = [ ] , $ message = null ) : JsonResponse { return $ this -> setStatusCode ( IlluminateResponse :: HTTP_CREATED ) -> respond ( [ 'status' => [ 'type' => 'success' , 'message' => $ this -> getDefaultMessage ( $ code , $ message ) , 'code' => $ code , 'http_code' => $ this -> getStatusCode ( ) , ] , 'data' => $ data , ] ) ; }
Returns 201 response with data.

@param int   $code
@param array $data
@param null  $message

@return \Illuminate\Http\JsonResponse
Returns 201 response with data .