PHPackages                             lazarusphp/requests - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. lazarusphp/requests

ActiveLibrary

lazarusphp/requests
===================

Psr-7 compatible Requests Library

v1.0.0(2mo ago)05↓100%GPL-3.0PHP

Since Mar 2Pushed 2mo agoCompare

[ Source](https://github.com/Lazarusphp/requests)[ Packagist](https://packagist.org/packages/lazarusphp/requests)[ RSS](/packages/lazarusphp-requests/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

LazarusPhp Requests
===================

[](#lazarusphp-requests)

What is this?
-------------

[](#what-is-this)

Requests is a psr-7 compatible Library Designed for sending and receiving http requests.

How to use
----------

[](#how-to-use)

the Requests Library automatically detects the request type based on the input provided ie post or get, therfore having no need to set the values.

### Installation

[](#installation)

```
composer require lazarusphp/requests
```

### sending data

[](#sending-data)

By default the class detects and Writes the values into an array upon request, this does not require the need to create individual values.

the following example will use lazarusphp querybuilder.

```
use LazarusPhp\Requests\Requests;
$requests = new Requests();

$query  = new QueryBuilder("users");
$query->insert(["username"=>$requests->username]);
```

### Retrieveing data

[](#retrieveing-data)

As shown above obtaining the user information can also be retrieved simply by calling `$requests->username` or `$requests->input("username")`

Validation Options
------------------

[](#validation-options)

By default apart from detecting if the value exists `Requests()` do not come with any out of the box validation `OOTB`, but can be accomplished by assigning a field rule.

These can be assigned in any order following 'field()'

### Assigning the rule.

[](#assigning-the-rule)

```
    $requests->field("username");
```

These can be assigned in any order following 'field()'

### Required value

[](#required-value)

`required()` checks if the request value is empty, an error will be thrown if this is true.

```
$requests->field("username")->required();
```

### minimum Value

[](#minimum-value)

Setting a minumum value will allow the system to check if the string lenght is valid, An exception will be thrown if not.

```
$requests->field("username")->min(3);
```

### Max Value

[](#max-value)

Setting a Maximum value will prevent the request exceeding the allocated string lenght.

An exception will be thrown if this is true.

```
$requests->field("username")->max(3);
```

### Match Value (confirm)

[](#match-value-confirm)

The `match()` method is put in place to confirm two inputs, failure will result in an exception being thrown.

```
$requests->field("username")->match("confirm_username");
```

As stated above all these methods can be chained and used in any order but must follow a new field request each time.

Duplicating validation methods will also throw an error.

```
// this will work

$request->field("username")->required()->min(4)->max(20)->match("confirm_username");

// this will fail Duplicate validation Request

$requests->field("username")->required()->min(4)->match("confirm_username")->match("confirm_email");
```

validate if Request is post or get.
-----------------------------------

[](#validate-if-request-is-post-or-get)

Although the class automatically determines what the request is, it is recommended that any requests are also validated using the `post` or `get` methods, these values must return true or false.

```
// Any Get Requests would be rejected by this method.
if($requests->post())
{
    echo "this is a post request";
//    Add Code here
}

// Post requests would be rejected by this method
if($requests->get())
{
    // Add Code here if the request is post"
}
```

safe output
-----------

[](#safe-output)

in certain situation such as pre submission of a form an input field may hold a value which would cause an undefined value error, this is resolved using the `$requests->safeField()` method and can be done like so.

```
echo '
```

This command will output the Request if one exists other wise will defaut to an empty string

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance85

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

77d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/42fe8da43e075694b07eeec0a2fb822ab60aa872bf765cb0434b919b43264479?d=identicon)[mbamber1986](/maintainers/mbamber1986)

---

Top Contributors

[![itzzpadre](https://avatars.githubusercontent.com/u/30671636?v=4)](https://github.com/itzzpadre "itzzpadre (9 commits)")

### Embed Badge

![Health badge](/badges/lazarusphp-requests/health.svg)

```
[![Health](https://phpackages.com/badges/lazarusphp-requests/health.svg)](https://phpackages.com/packages/lazarusphp-requests)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
