PHPackages                             geekgroveofficial/php-smart-validator - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. geekgroveofficial/php-smart-validator

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

geekgroveofficial/php-smart-validator
=====================================

A smart validation package for PHP

v1.0.3(1y ago)10294↓100%[1 issues](https://github.com/geekGroveOfficial/php-smart-validator/issues)MITPHPPHP ^8.0

Since Aug 28Pushed 1y ago1 watchersCompare

[ Source](https://github.com/geekGroveOfficial/php-smart-validator)[ Packagist](https://packagist.org/packages/geekgroveofficial/php-smart-validator)[ RSS](/packages/geekgroveofficial-php-smart-validator/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (5)Used By (0)

PHP Smart Validator
===================

[](#php-smart-validator)

`php-smart-validator` is a flexible and extensible PHP package for validating data. It provides a set of common validation rules and allows for custom rule definitions. This package is designed to be easy to use and integrate into any PHP project.

Features
--------

[](#features)

- Supports common validation rules like `required`
- Easy to extend with new validation rules
- PSR-4 autoloading for seamless integration

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

[](#installation)

You can install the package via Composer. Run the following command in your terminal:

```
composer require GeekGroveOfficial/php-smart-validator
```

Supported Validation Rules
--------------------------

[](#supported-validation-rules)

The following validation rules are supported out of the box:

- **required**: Ensures the field is present and not empty.
- **min**: Ensures the field value is at least a certain length or size.
- **max**: Ensures the field value does not exceed a certain length or size.
- **string**: Ensures the field value is a string.
- **integer** or **int**: Ensures the field value is an integer.
- **boolean** or **bool**: Ensures the field value is a boolean.
- **email**: Ensures the field value is a valid email address.
- **date**: Ensures the field value is a valid date.
- **array**: Ensures the field value is an array.
- **in**: Ensures the field value is within a specified set of values.
- **url**: Ensures the field value is a valid URL.
- **ip**: Ensures the field value is a valid IP address.
- **json**: Ensures the field value is a valid JSON string.
- **regex**: Ensures the field value matches a specified regular expression pattern.
- **uuid**: Ensures the field value is a valid UUID.
- **image**: Ensures the field value is a valid image file.
- **files**: Ensures the field value is valid files according to specified rules.

Basic Usage
-----------

[](#basic-usage)

### Setting Up

[](#setting-up)

First, create a validation instance by passing the data and rules:

```
use GeekGroveOfficial\PhpSmartValidator\Validator\Validator;

$data = [
    'email' => 'example@example.com',
    'password' => 'secret'
];

$rules = [
    'email' => ['required','email'],
    'password' => ['required','min:6']
];

$validator = new Validator($data, $rules);

if ($validator->validate()) {
    echo "Validation passed!";
} else {
    print_r($validator->errors());
}
```

Running Tests
-------------

[](#running-tests)

To ensure everything is working correctly, you can run the tests using PHPUnit. First, install PHPUnit if you haven't already:

```
composer require --dev phpunit/phpunit
```

Then run the tests:

```
./vendor/bin/phpunit
```

Contributing
------------

[](#contributing)

Contributions are welcome! If you have suggestions, improvements, or bug fixes, please follow these steps:

1. Fork the repository.
2. Create a feature branch (`git checkout -b feature/your-feature`).
3. Commit your changes (`git commit -am 'Add new feature'`).
4. Push to the branch (`git push origin feature/your-feature`).
5. Open a pull request.

Please ensure that your code adheres to the existing style and includes appropriate tests.

###  Health Score

32

—

LowBetter than 71% of packages

Maintenance42

Moderate activity, may be stable

Popularity20

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 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 ~4 days

Total

4

Last Release

606d ago

### Community

Maintainers

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

---

Top Contributors

[![soheilkhaledabdi](https://avatars.githubusercontent.com/u/96084779?v=4)](https://github.com/soheilkhaledabdi "soheilkhaledabdi (14 commits)")

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/geekgroveofficial-php-smart-validator/health.svg)

```
[![Health](https://phpackages.com/badges/geekgroveofficial-php-smart-validator/health.svg)](https://phpackages.com/packages/geekgroveofficial-php-smart-validator)
```

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)

PHPackages © 2026

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