kosv / randomuser-client
Library for getting data from randomuser.me.
v1.0.0
2022-01-25 23:24 UTC
Requires
- php: >=7.4
- ext-json: *
Requires (Dev)
- phpunit/phpunit: ^8.5 || ^9.0
README
Simple library for getting data from randomuser.me
service.
Installation
composer require kosv/randomuser-client:^1.0.0
Example
<?php use Kosv\RandomUser\Client\{Client, QueryBuilder}; use Kosv\RandomUser\Transport\CurlTransport; $client = new Client(new CurlTransport()); $query = new QueryBuilder(); $query->setIncludeFields(['name', 'email'])->setPage(3)->setMaxResult(100); $response = $client->request($query); $users = $response->getUsers(); $info = $response->getInfo();