kosv/randomuser-client

Library for getting data from randomuser.me.

v1.0.0 2022-01-25 23:24 UTC

This package is auto-updated.

Last update: 2024-10-26 05:12:51 UTC


README

Build Status Scrutinizer Code Quality

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();