PHPackages                             farbcode/laravel-stateful-resources - 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. [API Development](/categories/api)
4. /
5. farbcode/laravel-stateful-resources

ActiveLibrary[API Development](/categories/api)

farbcode/laravel-stateful-resources
===================================

A Laravel package for managing state in API resources.

v1.0.0(3mo ago)52.7k—1.8%MITPHPPHP ^8.4CI passing

Since Jul 23Pushed 1w ago1 watchersCompare

[ Source](https://github.com/farbcodegmbh/laravel-stateful-resources)[ Packagist](https://packagist.org/packages/farbcode/laravel-stateful-resources)[ Docs](https://github.com/farbcodegmbh/laravel-stateful-resources)[ RSS](/packages/farbcode-laravel-stateful-resources/feed)WikiDiscussions main Synced yesterday

READMEChangelog (4)Dependencies (24)Versions (10)Used By (0)

 Laravel Stateful Resources
============================

[](#-laravel-stateful-resources-)

[![Latest Version on Packagist](https://camo.githubusercontent.com/0733756a4af938636f84fadceb092186ee50753905f9360037708ded2e3fd03f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f66617262636f64652f6c61726176656c2d737461746566756c2d7265736f75726365732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/farbcode/laravel-stateful-resources)[![GitHub Tests Action Status](https://camo.githubusercontent.com/8399caaab7cf6b5166bb5728a7564571be9947d5ed9e5adb9b452bb1093c4fe0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f66617262636f6465676d62682f6c61726176656c2d737461746566756c2d7265736f75726365732f72756e2d74657374732e796d6c3f6272616e63683d6d61696e266c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/farbcodegmbh/laravel-stateful-resources/actions?query=workflow%3Arun-tests+branch%3Amain)[![GitHub Code Style Action Status](https://camo.githubusercontent.com/33a5ddb17e3f49f0ae2b7abab0685355caf903ca413f0f748e9f844b2206e9d4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f66617262636f6465676d62682f6c61726176656c2d737461746566756c2d7265736f75726365732f6669782d7068702d636f64652d7374796c652d6973737565732e796d6c3f6272616e63683d6d61696e266c6162656c3d636f64652532307374796c65267374796c653d666c61742d737175617265)](https://github.com/farbcodegmbh/laravel-stateful-resources/actions?query=workflow%3A%22Fix+PHP+code+style+issues%22+branch%3Amain)[![Total Downloads](https://camo.githubusercontent.com/ebc878f3b2507397bd45ccfb5b7f6773f2f01ace224b94a90baf3966083f4cad/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f66617262636f64652f6c61726176656c2d737461746566756c2d7265736f75726365732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/farbcode/laravel-stateful-resources)

A Laravel package for managing state in API resources.

Features
--------

[](#features)

- 🧘🏻‍♂️ **Unified Resources:** Provide multiple resource representations through a single resource class.
- 🏗️ **Built-in States:** Comes with default states for common use cases.
- 🪄 **Magic Methods:** Optional magic methods for a more fluent and expressive syntax.
- 🛠️ **Hackable:** Extend the package with your own custom states and logic.

Documentation
-------------

[](#documentation)

All information on how to use this package can be found on our official documentation website.

[→ Read the Docs](https://stateful-resources.farbcode.net)

Changelog
---------

[](#changelog)

Notable changes to this package are documented in our changelog for every new release.

[→ See what's changed](CHANGELOG.md)

Contributing
------------

[](#contributing)

We welcome contributions to this package.

[→ Read our Contribution Guidelines](CONTRIBUTING.md)

[→ Open an Issue](https://github.com/farbcodegmbh/laravel-stateful-resources/issues)

[→ Submit a Pull Request](https://github.com/farbcodegmbh/laravel-stateful-resources/pulls)

License
-------

[](#license)

The MIT License (MIT). See [License File](LICENSE.md) for more information.

---

[    ![farbcode Logo](https://raw.githubusercontent.com/farbcodegmbh/laravel-stateful-resources/HEAD/art/farbcode-logo-light.png) ](https://farbcode.net)> Made with ❤️ by [//farbcode](https://farbcode.net).

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance91

Actively maintained with recent releases

Popularity26

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 74.8% 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 ~83 days

Total

4

Last Release

94d ago

Major Versions

v0.3.0 → v1.0.02026-03-31

### Community

Maintainers

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

---

Top Contributors

[![julian-farbcode](https://avatars.githubusercontent.com/u/110020845?v=4)](https://github.com/julian-farbcode "julian-farbcode (77 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (19 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (3 commits)")[![jsperrer](https://avatars.githubusercontent.com/u/129270249?v=4)](https://github.com/jsperrer "jsperrer (2 commits)")[![RaphaelStoerk](https://avatars.githubusercontent.com/u/22885975?v=4)](https://github.com/RaphaelStoerk "RaphaelStoerk (2 commits)")

---

Tags

laravellaravel-packagelaravel-resourcesstateapilaravelresourceslaravel-stateful-resources

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/farbcode-laravel-stateful-resources/health.svg)

```
[![Health](https://phpackages.com/badges/farbcode-laravel-stateful-resources/health.svg)](https://phpackages.com/packages/farbcode-laravel-stateful-resources)
```

###  Alternatives

[dedoc/scramble

Automatic generation of API documentation for Laravel applications.

2.1k11.2M100](/packages/dedoc-scramble)[spatie/laravel-pdf

Create PDFs in Laravel apps

1.0k4.8M47](/packages/spatie-laravel-pdf)[defstudio/telegraph

A laravel facade to interact with Telegram Bots

816333.3k3](/packages/defstudio-telegraph)[rawilk/profile-filament-plugin

Profile &amp; MFA starter kit for filament.

3914.6k](/packages/rawilk-profile-filament-plugin)[simplestats-io/laravel-client

Server-side analytics for Laravel that follows the full funnel from visit to registration to payment, attributed to the channel that drove it. Revenue, MRR, churn and ad-spend profit (ROAS/CAC) per channel. GDPR compliant, ad-blocker proof.

5021.9k](/packages/simplestats-io-laravel-client)[lettermint/lettermint-laravel

Official Lettermint driver for Laravel

1190.2k1](/packages/lettermint-lettermint-laravel)

PHPackages © 2026

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