PHPackages                             min/fractalcommands - 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. [CLI &amp; Console](/categories/cli)
4. /
5. min/fractalcommands

ActiveLibrary[CLI &amp; Console](/categories/cli)

min/fractalcommands
===================

Laravel commands for fractal

042PHP

Since Mar 17Pushed 9y ago1 watchersCompare

[ Source](https://github.com/leexikang/fractal-commands)[ Packagist](https://packagist.org/packages/min/fractalcommands)[ RSS](/packages/min-fractalcommands/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

### Fractal-commands commands for using Fractal on Laravel's project.

[](#fractal-commands-commands-for-using-fractal-on-laravels-project)

For more about Fractal Please go to [Fractal Document](http://fractal.thephpleague.com/).

### Install

[](#install)

```
composer require min/fractalcommands

```

##### add service provider

[](#add-service-provider)

dd class to config/app.php

```
Min\FractalCommands\FractalCommandsServiceProvider::class

```

#### Commands

[](#commands)

- php artisan fractal:init (create App/Api/Tranformer/ and Controllers/ApiControler)
- php artisan tranformer:create {Tranformer} --model={model} (Create Tranformer in App\\Api\\Tranformer)

### Usages

[](#usages)

To use fractal on your controller, extend the Controller first which is created by the fractal:init command. Then call the tranform method povided by the Api Controller and pass the Sepcific tranformer class.

```
$this->transform(Post::all(), new PostTransformer);
```

To tranform single item (model), use tranform command

```
$this->transform(Post::find(1), new PostTransformer);
```

⚠️ Call the parenet's (ApiController) constructor if you want to extend the Controller's constructor

```
parent::__construct();
```

The tranformer:create command will create the layout for your Tranformer in the App/Api/Tranformer Directory.

### Licence

[](#licence)

MIT

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

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/7593e94f692b742b6a4a09a0a24dc19d483429d5bdb97c6e783abf111b940a7f?d=identicon)[leexikang](/maintainers/leexikang)

---

Top Contributors

[![mg-minsan](https://avatars.githubusercontent.com/u/6611494?v=4)](https://github.com/mg-minsan "mg-minsan (21 commits)")

### Embed Badge

![Health badge](/badges/min-fractalcommands/health.svg)

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

###  Alternatives

[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24726.4M22](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

13045.3M6.2k](/packages/illuminate-console)[styleci/cli

The CLI tool for StyleCI

71464.1k9](/packages/styleci-cli)[winbox/args

Windows command-line formatter

20718.9k21](/packages/winbox-args)

PHPackages © 2026

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