PHPackages                             modus/forms - 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. modus/forms

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

modus/forms
===========

A form validation library for Modus Framework.

2.1(6y ago)0113MITPHP

Since Sep 13Pushed 6y agoCompare

[ Source](https://github.com/modusphp/forms)[ Packagist](https://packagist.org/packages/modus/forms)[ RSS](/packages/modus-forms/feed)WikiDiscussions master Synced 1mo ago

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

Forms
=====

[](#forms)

Forms is a dead simple library for validating incoming data, whether that data be from the $\_POST superglobal or from the CLI, or from any other source.

Setup
-----

[](#setup)

In order to use Forms, you need to extend the `FormsBase` class, and implement two values: `$fields` and `configureValidations()`.

The `$fields` property contains an array of fields you'll be passing into the form, for the purposes of separating the valid content from content you don't care about. It should be an array of valid strings:

```
$fields = [
  'username',
  'password',
  'password_verify',
];
```

Once you have defined the `$fields` property, you can build your validations in the `configureValidations()` method.

```
protected function configureValidations()
{
  $filter = $this->filter;
  $filter->addSoftRule('username', $filter::IS, 'alnum');
  $filter->addSoftRule('username', $filter::IS_NOT, 'blank');
  $filter->addSoftRule('password', $filter::IS_NOT, 'blank');
  $filter->addSoftRule('password_verify', $filter::IS, 'equalToField', 'password');
}
```

Using Forms
-----------

[](#using-forms)

Once you have completed basic setup, now you're ready to use Forms.

To populate the form, call the `populateData` method with an array of data to be populated and filtered.

To filter the data, call `validate()`.

The `getError`, `hasErrors` and `getErrors` functions all provide access to various errors, if `validate()` should return false. You can use `isValid()` to determine if there are errors to be retrieved.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity65

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

Total

3

Last Release

2534d ago

Major Versions

1.0 → 2.02017-08-25

### Community

Maintainers

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

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/modus-forms/health.svg)

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

###  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)
