PHPackages                             rdarcy1/fractal-helpers - 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. rdarcy1/fractal-helpers

Abandoned → [konsulting/fractal-helpers](/?search=konsulting%2Ffractal-helpers)Library[Utility &amp; Helpers](/categories/utility)

rdarcy1/fractal-helpers
=======================

0.5.0(5y ago)0641MITPHPCI failing

Since Jun 6Pushed 1y ago1 watchersCompare

[ Source](https://github.com/rdarcy1/fractal-helpers)[ Packagist](https://packagist.org/packages/rdarcy1/fractal-helpers)[ RSS](/packages/rdarcy1-fractal-helpers/feed)WikiDiscussions master Synced yesterday

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

Fractal Helpers
===============

[](#fractal-helpers)

A small extension for [Fractal](https://fractal.thephpleague.com) that makes it easy to include relationships on a resource. Designed for use with Laravel/Eloquent, but it will work with any model or resource that expresses the same interface for retrieving relationships.

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

[](#installation)

```
composer require konsulting/fractal-helpers

```

Usage
-----

[](#usage)

To make use of this package, in your transformers extend `Konsulting\FractalHelpers\TransformerAbstract` rather than the base Fractal transformer.

When building up APIs with Fractal I found myself repeating the same code to include relations on my Eloquent models:

```
// BookTransformer.php

protected $availableIncludes = [
    'author',
    'characters'
];

public function includeAuthor(Book $book) {
     return $this->item($book->author, new AuthorTransformer);
}

public function includeCharacters(Book $book) {
    return $this->collection($book->characters, new CharacterTransformer);
}
```

With the included `TransformerAbstract` class, you can express the above code more succinctly as:

```
// BookTransformer.php

protected $itemIncludes = [
    'author' => AuthorTransformer::class,
];

protected $collectionIncludes = [
    'characters' => CharacterTransformer::class,
];
```

Null relationships
------------------

[](#null-relationships)

If a relationship returns `null`, it will automatically be converted to a `League\Fractal\Resource\NullResource` object rather than passing to the associated transformer for that relationship. This means it's not necessary to check for null within each transformer.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 89.5% 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 ~191 days

Recently: every ~239 days

Total

6

Last Release

1940d ago

### Community

Maintainers

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

---

Top Contributors

[![rdarcy1](https://avatars.githubusercontent.com/u/15962421?v=4)](https://github.com/rdarcy1 "rdarcy1 (17 commits)")[![Keoghan](https://avatars.githubusercontent.com/u/6714599?v=4)](https://github.com/Keoghan "Keoghan (1 commits)")[![lloricode](https://avatars.githubusercontent.com/u/8251344?v=4)](https://github.com/lloricode "lloricode (1 commits)")

---

Tags

fractallaravelphp7

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rdarcy1-fractal-helpers/health.svg)

```
[![Health](https://phpackages.com/badges/rdarcy1-fractal-helpers/health.svg)](https://phpackages.com/packages/rdarcy1-fractal-helpers)
```

###  Alternatives

[grumpydictator/firefly-iii

Firefly III: a personal finances manager.

22.8k69.3k](/packages/grumpydictator-firefly-iii)[pragmarx/coollection

Laravel Illuminate collection with objectified properties

943.4M11](/packages/pragmarx-coollection)

PHPackages © 2026

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