public static function makeFromExisting(IlluminateResponse $old)
    {
        // Support for custom status code and message
        $statusCode = ($old instanceof self) ? $old->getStatusCodeAndMessage() : $old->getStatusCode();

        // Generate API response from response object
        $new = static::create($old->getOriginalContent(), $statusCode);
        $new->headers = $old->headers;

        return $new;
    }
public static function makeFromExisting(IlluminateResponse $old)
    {
        // Support for custom status code and message
        $statusCode = ($old instanceof self) ? $old->getStatusCodeAndMessage() : $old->getStatusCode();

        // Generate API response from response object
        $new = static::create($old->getOriginalContent(), $statusCode);
        $new->headers = $old->headers;

        return $new;
    }
public static function makeFromExisting ( IlluminateResponse $ old ) { // Support for custom status code and message $ statusCode = ( $ old instanceof self ) ? $ old -> getStatusCodeAndMessage ( ) : $ old -> getStatusCode ( ) ; // Generate API response from response object $ new = static :: create ( $ old -> getOriginalContent ( ) , $ statusCode ) ; $ new -> headers = $ old -> headers ; return $ new ; }
Make an API response from an existing response object.

@author Morten Rugaard <moru@nodes.dk>

@param  \Illuminate\Http\Response $old
@return \Nodes\Api\Http\Response
Make an API response from an existing response object .