PHPackages                             kregel/transformer - 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. kregel/transformer

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

kregel/transformer
==================

This package takes an array, maps it to new values, and outputs the new values

017PHP

Since May 10Pushed 8y ago1 watchersCompare

[ Source](https://github.com/metabitco/transform)[ Packagist](https://packagist.org/packages/kregel/transformer)[ RSS](/packages/kregel-transformer/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

What is this package?
=====================

[](#what-is-this-package)

This package is meant to take an array of data and "transform" it to match the pattern of another array.

How do I use it?
----------------

[](#how-do-i-use-it)

```
use Kregel\Transform\Transformer;

$dataTransformer = new Transformer([
    'NAME' => 'Austin Kregel
], [
    'NAME' => 'full_name'
]);

$dataTransformer->transform();
```

or

```
use Kregel\Transform\Transformer;

$dataTransformer = new Transformer;

$dataTransformer->setOriginalFeed([
    'NAME' => 'Austin Kregel'
])

$dataTransformer->setKeys([
    'NAME' => 'full_name'
]);

$dataTransformer->transform();
```

Then transform will return an array

```
[
    'full_name' => 'Austin Kregel'
]

```

If you're using laravel you can use the `LaravelModelTransformer` to get the same functionality for your models.

```
class User extends LaravelModelTransformer
{
    public $fillable = [
        'full_name'
    ];

    public function posts()
    {
        return $this->hasMany(Post::class);
    }

    public function getKeys()
    {
        return [
            'full_name' => 'name',
            'posts' => 'blogPosts'
        ];
    }
}
```

Then you could use

```
$user = User::first();

$user->transform();
```

What could this be used for?
----------------------------

[](#what-could-this-be-used-for)

Well, what you *could* use it for is a list unmeasurable... What I plan on doing with it, is build an API that gracefully ages. Much like the way Stripe supports older versions of their api. This allows us as developers to change the data we receive and put it into the format we need. So long as we control it, the api could be upgraded as many times as we need, and we only need to remap the inputs/outputs to the respective values for it to work.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/2c5c1ee0adf552aec8a54c1760dd99c4d1b90c0360dccafeef849a14ff37f706?d=identicon)[austinkregel](/maintainers/austinkregel)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/kregel-transformer/health.svg)

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

###  Alternatives

[dr-que/polynomial-regression

Calculates and returns coefficients for polynomial regression.

22214.6k3](/packages/dr-que-polynomial-regression)

PHPackages © 2026

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