protected function handlePayload($payload)
    {
        if(is_null($payload)) {
            return $this->buildEmptyResponse();
        }

        if(is_bool($payload)) {
            return $this->buildEmptyResponse();
        }

        if(is_string($payload)) {
            return $this->buildStringResponse($payload);
        }

        return $this->isIlluminateResource($payload)
            ? $this->buildResponse($payload) 
            : $this->buildResponse($this->intoResource($payload));
    }
protected function handlePayload($payload)
    {
        if(is_null($payload)) {
            return $this->buildEmptyResponse();
        }

        if(is_bool($payload)) {
            return $this->buildEmptyResponse();
        }

        if(is_string($payload)) {
            return $this->buildStringResponse($payload);
        }

        return $this->isIlluminateResource($payload)
            ? $this->buildResponse($payload) 
            : $this->buildResponse($this->intoResource($payload));
    }
protected function handlePayload ( $ payload ) { if ( is_null ( $ payload ) ) { return $ this -> buildEmptyResponse ( ) ; } if ( is_bool ( $ payload ) ) { return $ this -> buildEmptyResponse ( ) ; } if ( is_string ( $ payload ) ) { return $ this -> buildStringResponse ( $ payload ) ; } return $ this -> isIlluminateResource ( $ payload ) ? $ this -> buildResponse ( $ payload ) : $ this -> buildResponse ( $ this -> intoResource ( $ payload ) ) ; }
Route payload to the corresponding JsonResponse builder

@param mixed $payload
@return JsonResponse
@throws ResponderException
Route payload to the corresponding JsonResponse builder