PHPackages                             flatphp/databag - 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. flatphp/databag

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

flatphp/databag
===============

Data Bag

v2.0.1(8y ago)018MITPHPPHP &gt;=5.5

Since Aug 8Pushed 8y ago1 watchersCompare

[ Source](https://github.com/flatphp/databag)[ Packagist](https://packagist.org/packages/flatphp/databag)[ RSS](/packages/flatphp-databag/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

databag
=======

[](#databag)

data bag component

\#install

```
composer require "flatphp/databag"

```

usage
=====

[](#usage)

```
use Flatphp\Databag\FilterBag;

class MyData extends FilterBag
{
    protected $rules = array(
        'data1' => 'trim|lower',
        'data2' => ['trim', 'required|email']
    );

    protected $messages = array(
        'data2.required' => 'data2 is required',
        'data2.email' => 'data2 must be email'
    );
}

$data = new MyData(array(
    'data1' => ' hello test ',
    'data2' => ' world'
));

if ($data->fail()) {
    echo $data->getFailedMessage();
} else {
    foreach ($data as $key => $value) {
	echo $key .' - '. $value;
    }
}
```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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

Total

2

Last Release

3248d ago

### Community

Maintainers

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

---

Top Contributors

[![shukyoo](https://avatars.githubusercontent.com/u/2231396?v=4)](https://github.com/shukyoo "shukyoo (1 commits)")

---

Tags

databag

### Embed Badge

![Health badge](/badges/flatphp-databag/health.svg)

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

PHPackages © 2026

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