PHPackages                             ngoubaux/delatbabel-fluents - 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. [Database &amp; ORM](/categories/database)
4. /
5. ngoubaux/delatbabel-fluents

ActiveLibrary[Database &amp; ORM](/categories/database)

ngoubaux/delatbabel-fluents
===========================

Convert Eloquent Model objects to and from Fluent objects.

v11.0(1y ago)0133MITPHPPHP ^8.1

Since Oct 30Pushed 1y agoCompare

[ Source](https://github.com/ngoubaux/delatbabel-fluents)[ Packagist](https://packagist.org/packages/ngoubaux/delatbabel-fluents)[ RSS](/packages/ngoubaux-delatbabel-fluents/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (3)

Fluents
=======

[](#fluents)

Laravel extension to convert to/from Fluent objects.

Rationale
---------

[](#rationale)

The Laravel Fluent object is one of the most under-rated and under-utilized components of the framework. Essentially a free-standing object, it allows you to access an array of attributes as an object rather than as an array.

example:

Instead of using an array like this:

```
$myArray = [];
$myArray['first'] = 'one';
$myArray['second'] = 'two;

echo $myArray['first']; // prints "one"
```

Use fluent object like this:

```
$myObject = new Fluent();
$myObject->first = 'one';
$myObject->second = 'two';

echo $myObject->first; // prints "one"
```

Until now, however, there has been no standard straightforwards way to convert an Eloquent Model object into a Fluent object. There is a toArray() function on a Model object but no equivalent toFluent() function.

This component adds such functions using a trait that can be applied to any model object. Note that several other of Laravel's internal classes can also have this trait applied, as long as they store their data in an internal `attributes` array this trait should work.

Usage
-----

[](#usage)

### Model Fill From Fluent Object

[](#model-fill-from-fluent-object)

```
use Delatbabel\Fluents\Fluents;

class User extends Eloquent {
    use Fluents;
}

$myFluent = new Fluent();
$myFluent->first = 'one';

$myUser = new User();
$myUser->fromFluent($myFluent);
```

### Model Convert From Fluent Object

[](#model-convert-from-fluent-object)

```
use Delatbabel\Fluents\Fluents;

class User extends Eloquent {
    use Fluents;
}

$myUser = User->find(1);
$myFluent = User->toFluent();
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 86.7% 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

Unknown

Total

1

Last Release

559d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3c18315a6809d3940f1277ddebaf7e1931553b5aacb67be0a2d0a3306962bbc1?d=identicon)[ngoubaux](/maintainers/ngoubaux)

---

Top Contributors

[![delatbabel](https://avatars.githubusercontent.com/u/2335362?v=4)](https://github.com/delatbabel "delatbabel (13 commits)")[![ngoubaux](https://avatars.githubusercontent.com/u/3824969?v=4)](https://github.com/ngoubaux "ngoubaux (2 commits)")

---

Tags

laraveleloquentfluentl5laravel5

### Embed Badge

![Health badge](/badges/ngoubaux-delatbabel-fluents/health.svg)

```
[![Health](https://phpackages.com/badges/ngoubaux-delatbabel-fluents/health.svg)](https://phpackages.com/packages/ngoubaux-delatbabel-fluents)
```

###  Alternatives

[watson/validating

Eloquent model validating trait.

9723.3M47](/packages/watson-validating)[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[reedware/laravel-relation-joins

Adds the ability to join on a relationship by name.

2121.2M13](/packages/reedware-laravel-relation-joins)[delatbabel/elocryptfive

Automatically encrypt and decrypt Eloquent attributes with ease.

8493.0k](/packages/delatbabel-elocryptfive)[rutorika/sortable

Adds sortable behavior and ordering to Laravel Eloquent models. Grouping and many to many supported.

299992.5k14](/packages/rutorika-sortable)[rtconner/laravel-likeable

Trait for Laravel Eloquent models to allow easy implementation of a 'like' or 'favorite' or 'remember' feature.

394388.0k5](/packages/rtconner-laravel-likeable)

PHPackages © 2026

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