PHPackages                             mezon/request - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. mezon/request

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mezon/request
=============

Small script for parameters fetcher

1.0.10(2mo ago)29.2k3MITPHPPHP &gt;=8.2.0

Since Dec 24Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/alexdodonov/mezon-request)[ Packagist](https://packagist.org/packages/mezon/request)[ Docs](https://github.com/alexdodonov/mezon-request)[ RSS](/packages/mezon-request/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (12)Used By (3)

Global access for request parameters
====================================

[](#global-access-for-request-parameters)

Intro
-----

[](#intro)

This class will help you to fetch data from $\_POST and $\_GET arrays.

Installation
------------

[](#installation)

Just print in console

```
composer require mezon/request

```

And that's all )

Learn more
==========

[](#learn-more)

More information can be found here:

[Twitter](https://twitter.com/mezonphp)

[dev.to](https://dev.to/alexdodonov)

[Slack](https://join.slack.com/t/mezon-framework/signup?x=x-p1148081653955-1171709616688-1154057706548)

How to start
============

[](#how-to-start)

The firs steps are quite simple

```
var_dump(Request::getParam('some-param', 'default'));// will be outputted 'default'

$_GET['some-param'] = 'some-value';
var_dump(Request::getParam('some-param'));// will be outputted 'some-value'
```

Fields priorities
=================

[](#fields-priorities)

In case you have the same parameters in $\_GET, $\_POST and other global arrays, then they will be prioritized in this way:

- security tokens in HTTP headers
- [Router parameters](https://github.com/alexdodonov/mezon-router)
- HTTP request headers
- $\_POST
- $\_GET

For example:

```
$_GET['some-param'] = 'get-value';
$_POST['some-param'] = 'post-value';

var_dump(Request::getParam('some-param'));// will be outputted 'post value'
```

Router parameters
=================

[](#router-parameters)

You can pass your [Router](https://github.com/alexdodonov/mezon-router) object to this class and fetch parameters for non-static routes:

```
Request::registerRouter();
```

Security tokens in HTTP headers
===============================

[](#security-tokens-in-http-headers)

There are a way to fetch security token from headers:

- Authentication
- Authorization
- Cgi-Authorization

For example if you will pass in headers something like that:

```
Authorization: Basic

```

And then call:

```
Request::getParam('session_id')
```

Then this call will return ``.

Wrappers
========

[](#wrappers)

There are some convenient wrappers were implemented:

```
// will return true if the parameter exists
// will return false otherwise
Request::wasSubmitted('param-name')
```

Or wrapper for check-boxes:

```
Request::getChecked('param-name', ['switched on', 'switched off'])
Request::getChecked('param-name', [1, 0])
Request::getChecked('param-name', [true, false])
```

In this call the method `getChecked` will return the first element of the array which is passed as the second parameter. And the second element otherwise.

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance83

Actively maintained with recent releases

Popularity24

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity72

Established project with proven stability

 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

Every ~188 days

Recently: every ~372 days

Total

11

Last Release

86d ago

PHP version history (2 changes)1.0.0PHP &gt;=7.2.0

1.0.10PHP &gt;=8.2.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/14943896?v=4)[alexdodonov](/maintainers/alexdodonov)[@alexdodonov](https://github.com/alexdodonov)

---

Top Contributors

[![alexdodonov](https://avatars.githubusercontent.com/u/14943896?v=4)](https://github.com/alexdodonov "alexdodonov (18 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mezon-request/health.svg)

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

PHPackages © 2026

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