PHPackages                             markhuot/craft-data - 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. markhuot/craft-data

ActiveCraft-plugin[Utility &amp; Helpers](/categories/utility)

markhuot/craft-data
===================

1.0.0(3y ago)03MITPHP

Since Oct 25Pushed 3y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

Craft Data
==========

[](#craft-data)

Automatically convert POST data over to strongly typed data objects. Attaching an attribute to your controller method is all it takes to do the conversion.

```
class EntryController extends Controller
{
    #[BodyParams(EntryUpdateParams::class)]
    function actionUpdate()
    {
        // Now $this->getData() will return an `EntryUpdateParams` with all the
        // data copied over from the POST in to the class
    }
}
```

The data object uses public properties and PHP type hints to map everything. See [markhuot/data](https://github.com/markhuot/data) for more detail on mapping.

```
class EntryUpdateParams
{
    public int $elementId;
    public ?string $title;
    public ?string $slug;

    function getElement()
    {
        return \Craft::$app->elements->getElementById($this->elementId);
    }
}
```

All validation rules fromm [markhuot/data](https://github.com/markhuot/data) work as well so you can ensure specific fields match the validation rules you expect.

```
use Symfony\Component\Validator\Constraints as Assert;

class EntryUpdateParams
{
    #[Assert\NotNull]
    public int $elementId;

    #[Assert\NotEmpty]
    public string $title;

    #[Assert\Regex('/[a-z]0-9_-/i')]
    public ?string $slug;

    function getElement()
    {
        return \Craft::$app->elements->getElementById($this->elementId);
    }
}
```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

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

Unknown

Total

1

Last Release

1301d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2628c4f6f6afddfe0b861cee15ae5b18c673d874f68786ebd1d01bba2dd6bdfb?d=identicon)[markhuot](/maintainers/markhuot)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/markhuot-craft-data/health.svg)

```
[![Health](https://phpackages.com/badges/markhuot-craft-data/health.svg)](https://phpackages.com/packages/markhuot-craft-data)
```

###  Alternatives

[vinkla/hashids

A Hashids bridge for Laravel

2.1k13.3M73](/packages/vinkla-hashids)[spicyweb/craft-neo

A Matrix-like field type with block hierarchy

395798.1k10](/packages/spicyweb-craft-neo)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

52664.9k12](/packages/solspace-craft-freeform)[elfsundae/laravel-hashid

A simple, elegant way to obfuscate your data by generating reversible, non-sequential, URL-safe identifiers.

415246.3k2](/packages/elfsundae-laravel-hashid)[supercool/tablemaker

Create customizable and user-defined table fields.

40141.7k](/packages/supercool-tablemaker)[verbb/vizy

A flexible visual editor field for Craft.

4348.6k](/packages/verbb-vizy)

PHPackages © 2026

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