diff --git a/src/Abstracts/AbstractApiResponse.php b/src/Abstracts/AbstractApiResponse.php index d4b11ba..a61ca43 100644 --- a/src/Abstracts/AbstractApiResponse.php +++ b/src/Abstracts/AbstractApiResponse.php @@ -82,6 +82,20 @@ public function hydrate($data) } } + /** + * Create a new response object and hydrate with data + * + * @param $data + * + * @return static + */ + public static function make($data) + { + $response = new static; + $response->hydrate($data); + return $response; + } + public function __call($method, $params) { if(starts_with($method, 'get'))