PHPackages                             wp-grogu/laravel-fluent-plus - 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. wp-grogu/laravel-fluent-plus

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

wp-grogu/laravel-fluent-plus
============================

A fork from janpantel/laravel-fluent-plus

v3.0.0(10mo ago)04.5k↑69.2%2MITPHPPHP ^8.2

Since Apr 19Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/WP-Grogu/Laravel-fluent-plus)[ Packagist](https://packagist.org/packages/wp-grogu/laravel-fluent-plus)[ RSS](/packages/wp-grogu-laravel-fluent-plus/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (2)Versions (7)Used By (2)

Laravel Fluent Plus
===================

[](#laravel-fluent-plus)

This package extends Laravel's `Fluent` class to provide a supercharged experience like type casting and recursive Fluent access to sub-assocs.

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

[](#installation)

Use composer to grep the package :

```
composer require wp-grogu/laravel-fluent-plus

```

Basic usage
-----------

[](#basic-usage)

Instead of extending `Illuminate\Support\Fluent` you extend `Grogu\FluentPlus\FluentPlus` instead. As this class is a superset of Fluent it can be treated as a drop in replacement.

`FluentPlus` implements a `$casts` property that defines how the attributes of your assoc should be cast.

For the following example assume `NamesContainer`, `Price`and `StockLevel` to be classes extending `Fluent`or `FluentPlus` as well.

```
class MyContainer extends FluentPlus
{
    protected $casts = [
        // Use the contents of the `names` attribute
        // to initialize a new `NamesContainer` instance.
        'names' => NamesContainer::class,

        // Assumes that the `price` attribute contains
        // an array and initializes a new `Price` instance
        // for every item.
        'prices' => [Price::class],

        // The same as the array syntax but using
        // Laravel's `Collection` class instead.
        'stock' => [
            \Illuminate\Support\Collection::class,
            StockLevel::class
        ],
    ];
}
```

The resulting object now offers convenient property access:

```
$container = new MyContainer($sourceAssoc);

var_dump($container->names->english);
var_dump($container->prices[0]->amount);
var_dump($container->stock->get('store_1')->quantity);
```

The problem this package solves
-------------------------------

[](#the-problem-this-package-solves)

If you work with assocs a lot and like using property access over assoc access Laravel's `Fluent` class is a convenient way to do so.

The use case that made me write this package is working with responses fetched from 3rd party APIs. Since I want to use `@property` PHP docs to have "type safety" while not manually assigning properties.

Advanced usage
--------------

[](#advanced-usage)

### Recursive array casts

[](#recursive-array-casts)

`FluentPlus` casts sub-assocs that do not have a cast defined into other FluentPlus for infinite dimension property access.

```
$instance = new Fluent(['foo' => ['bar' => 'baz']]);
$instancePlus = new FluentPlus(['foo' => ['bar' => 'baz']]);

// breaks :(
var_dump($instance->foo->bar);
// works :)
var_dump($instancePlus->foo->bar);
```

You can turn this feature off by setting the `$recursive`property in your derived `FluentPlus` to `false` or using the `NonRecursiveFluentPlus` utility class if you want to inline it instead.

###  Health Score

42

—

FairBetter than 88% of packages

Maintenance55

Moderate activity, may be stable

Popularity22

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 92.3% 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 ~247 days

Recently: every ~127 days

Total

6

Last Release

304d ago

Major Versions

v1.x-dev → v2.0.02025-02-08

v2.0.1 → v3.0.02025-09-04

PHP version history (3 changes)v1.0.0PHP ^7.3|^8.0

v2.0.0PHP ^8.0

v3.0.0PHP ^8.2

### Community

Maintainers

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

---

Top Contributors

[![tgeorgel](https://avatars.githubusercontent.com/u/11785727?v=4)](https://github.com/tgeorgel "tgeorgel (12 commits)")[![janpantel](https://avatars.githubusercontent.com/u/1828275?v=4)](https://github.com/janpantel "janpantel (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/wp-grogu-laravel-fluent-plus/health.svg)

```
[![Health](https://phpackages.com/badges/wp-grogu-laravel-fluent-plus/health.svg)](https://phpackages.com/packages/wp-grogu-laravel-fluent-plus)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[renatomarinho/laravel-page-speed

Laravel Page Speed

2.5k1.7M10](/packages/renatomarinho-laravel-page-speed)[illuminate/pagination

The Illuminate Pagination package.

12234.1M1.0k](/packages/illuminate-pagination)[illuminate/pipeline

The Illuminate Pipeline package.

9349.2M282](/packages/illuminate-pipeline)[illuminate/redis

The Illuminate Redis package.

8314.6M377](/packages/illuminate-redis)[illuminate/cookie

The Illuminate Cookie package.

244.6M137](/packages/illuminate-cookie)

PHPackages © 2026

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