PHPackages                             monirsaikat/php22 - 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. [Framework](/categories/framework)
4. /
5. monirsaikat/php22

ActiveLibrary[Framework](/categories/framework)

monirsaikat/php22
=================

A lightweight PHP framework for custom applications.

v1.0.0-alpha(1y ago)05MITPHP

Since Nov 24Pushed 1y ago1 watchersCompare

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

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

php22
=====

[](#php22)

To install: `composer require monirsaikat/php22:dev-main`

Request
=======

[](#request)

The `Request` class provides a set of methods to interact with the HTTP request data, including inputs, query parameters, headers, cookies, files, and more.

Methods
-------

[](#methods)

### `isPost(): bool`

[](#ispost-bool)

- **Description**: Checks if the current request is a POST request.
- **Returns**: `true` if the request method is POST, `false` otherwise.

### `isGet(): bool`

[](#isget-bool)

- **Description**: Checks if the current request is a GET request.
- **Returns**: `true` if the request method is GET, `false` otherwise.

### `input(string $key, $default = null)`

[](#inputstring-key-default--null)

- **Description**: Retrieves a specific input value from the POST data.
- **Parameters**:
    - `$key` (string): The key to retrieve from the input.
    - `$default` (mixed): The default value if the key doesn't exist.
- **Returns**: The value associated with the key, or the default value.

### `all(): array`

[](#all-array)

- **Description**: Retrieves all input data from the POST request.
- **Returns**: An associative array of all POST data.

### `query(string $key, $default = null)`

[](#querystring-key-default--null)

- **Description**: Retrieves a specific query parameter from the GET data.
- **Parameters**:
    - `$key` (string): The key to retrieve from the query parameters.
    - `$default` (mixed): The default value if the key doesn't exist.
- **Returns**: The value associated with the key, or the default value.

### `allQuery(): array`

[](#allquery-array)

- **Description**: Retrieves all query parameters from the GET request.
- **Returns**: An associative array of all GET data.

### `header(string $key, $default = null)`

[](#headerstring-key-default--null)

- **Description**: Retrieves a specific header value.
- **Parameters**:
    - `$key` (string): The header name.
    - `$default` (mixed): The default value if the header doesn't exist.
- **Returns**: The value of the specified header, or the default value.

### `headers(): array`

[](#headers-array)

- **Description**: Retrieves all headers from the current request.
- **Returns**: An associative array of all headers.

### `cookie(string $key, $default = null)`

[](#cookiestring-key-default--null)

- **Description**: Retrieves a specific cookie value.
- **Parameters**:
    - `$key` (string): The cookie name.
    - `$default` (mixed): The default value if the cookie doesn't exist.
- **Returns**: The value of the specified cookie, or the default value.

### `allCookies(): array`

[](#allcookies-array)

- **Description**: Retrieves all cookies from the current request.
- **Returns**: An associative array of all cookies.

### `file(string $key): ?array`

[](#filestring-key-array)

- **Description**: Retrieves a specific uploaded file.
- **Parameters**:
    - `$key` (string): The file input name.
- **Returns**: An array containing file information, or `null` if not found.

### `allFiles(): array`

[](#allfiles-array)

- **Description**: Retrieves all uploaded files from the current request.
- **Returns**: An associative array of all uploaded files.

### `method(): string`

[](#method-string)

- **Description**: Gets the HTTP request method.
- **Returns**: The request method as a string (e.g., 'GET', 'POST').

### `uri(): string`

[](#uri-string)

- **Description**: Gets the full request URI.
- **Returns**: The request URI as a string.

### `path(): string`

[](#path-string)

- **Description**: Gets the request path without the query string.
- **Returns**: The request path as a string.

### `ip(): ?string`

[](#ip-string)

- **Description**: Gets the client's IP address.
- **Returns**: The IP address as a string, or `null` if not available.

### `isAjax(): bool`

[](#isajax-bool)

- **Description**: Checks if the request is an AJAX request.
- **Returns**: `true` if the request is an AJAX request, `false` otherwise.

### `isSecure(): bool`

[](#issecure-bool)

- **Description**: Checks if the request is made over HTTPS.
- **Returns**: `true` if the request is secure, `false` otherwise.

### `json(bool $assoc = true)`

[](#jsonbool-assoc--true)

- **Description**: Retrieves JSON input data from the request body.
- **Parameters**:
    - `$assoc` (bool): Whether to return the data as an associative array (`true`) or an object (`false`).
- **Returns**: The decoded JSON data.

### `validate(array $rules): array`

[](#validatearray-rules-array)

- **Description**: Validates the input data using the given rules.
- **Parameters**:
    - `$rules` (array): An associative array of validation rules (e.g., `['username' => 'required']`).
- **Returns**: The validated data.
- **Note**: If validation fails, errors are flashed, and the user is redirected.

---

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity26

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

541d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/bf6dc3704b141ac51163154444ae51ba6e61c588163825dc312775a36a93363c?d=identicon)[monirsaikat](/maintainers/monirsaikat)

---

Top Contributors

[![monirsaikat](https://avatars.githubusercontent.com/u/72160277?v=4)](https://github.com/monirsaikat "monirsaikat (49 commits)")

### Embed Badge

![Health badge](/badges/monirsaikat-php22/health.svg)

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

###  Alternatives

[laravel/passport

Laravel Passport provides OAuth2 server support to Laravel.

3.4k85.0M532](/packages/laravel-passport)[nolimits4web/swiper

Most modern mobile touch slider and framework with hardware accelerated transitions

41.8k177.2k1](/packages/nolimits4web-swiper)[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k36.7M259](/packages/laravel-dusk)[laravel/prompts

Add beautiful and user-friendly forms to your command-line applications.

712181.8M596](/packages/laravel-prompts)[cakephp/chronos

A simple API extension for DateTime.

1.4k47.7M121](/packages/cakephp-chronos)[laravel/pail

Easily delve into your Laravel application's log files directly from the command line.

91545.3M590](/packages/laravel-pail)

PHPackages © 2026

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