Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Syntax suger of get request
/**
* @param string|Uri $uri
* @param array $query
*
* @return callable
*/
function resource($uri, array $query)
{
$resource = (new Injector(new AppModule, __DIR__ . '/tmp'))->getInstance(ResourceInterface::class);
$request = $resource->get->uri($uri)->withQuery($query)->eager->request();
return $request;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment