PHPackages                             beaumind/eloquent-complement - 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. beaumind/eloquent-complement

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

beaumind/eloquent-complement
============================

add some usable features to laravel eloquent

1.0.1(9y ago)116MITPHPPHP &gt;=5.4

Since Jan 8Pushed 9y agoCompare

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

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

eloquent-complement
===================

[](#eloquent-complement)

add some usable features to laravel eloquent for laravel 5+.

Installation
============

[](#installation)

Simply Run the Composer require comand.

```
composer require beaumind/eloquent-complement

```

```
use Beaumind\EloquentComplement\EloquentComplement;

class Question extends Model
{
    use EloquentComplement;

    public function user()
    {
        return $this->belongsTo('User');
    }

    public function answers()
    {
        return $this->hasMany('Answer');
    }

}
```

```
class Answer extends Model
{
    ...
}
```

```
class User extends Model
{
    ...
}
```

Save Associated models
======================

[](#save-associated-models)

you can now save question and related models in one step. it is atomic and it will role back on failure. also it fill foreign keys automatically.

```
$question['body'] = 'some question body';

$question['user']['name'] = 'joe';
$question['user']['username'] = 'joe_m';
...

$question['answers']['body'] = 'some answer body';
$question['answers']['is_correct'] = true;
```

now save in database.

```
(New Question())->saveAssociated($question, ['user','answers']);
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity58

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3408d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/24860137?v=4)[Amir Hassani](/maintainers/beaumind)[@beaumind](https://github.com/beaumind)

---

Top Contributors

[![beaumind](https://avatars.githubusercontent.com/u/24860137?v=4)](https://github.com/beaumind "beaumind (13 commits)")

### Embed Badge

![Health badge](/badges/beaumind-eloquent-complement/health.svg)

```
[![Health](https://phpackages.com/badges/beaumind-eloquent-complement/health.svg)](https://phpackages.com/packages/beaumind-eloquent-complement)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M683](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M157](/packages/orchestra-canvas)[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M210](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M858](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

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