sunnykk/reqres

package that provides a service for retrieving users via a remote API

dev-main 2022-12-22 08:15 UTC

This package is auto-updated.

Last update: 2025-05-22 13:34:20 UTC


README

"# reqres" A method to retrieve a single user by ID

A method to retrieve a paginated list of users

The service should convert the returned data to a simple, JSON serializable user model for consumption by the user of the package.

Installation

This project using composer.

composer require sunnykk/reqres:dev-main

** Usage **

require_once DIR . '/vendor/autoload.php'; // Autoload files using Composer autoload

use reqres\Reqres;

$Reqres = new Reqres();

echo $getuserbyID = $Reqres->GetUserById(2);

echo $getuserbyID = $Reqres->PaginatedListOfUsers();

You can check the index file , Where I have added the same code to show the json result :