PHPackages                             johnwhitley/seperate-eloquent-concerns - 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. johnwhitley/seperate-eloquent-concerns

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

johnwhitley/seperate-eloquent-concerns
======================================

Laravel eloquent has a lot in the model class, this package helps with separating the concerns away from just the model

v0.0.1(9y ago)010BSD-3-ClausePHP

Since Dec 4Pushed 9y ago1 watchersCompare

[ Source](https://github.com/john-whitley/seperate-eloquent-concerns)[ Packagist](https://packagist.org/packages/johnwhitley/seperate-eloquent-concerns)[ RSS](/packages/johnwhitley-seperate-eloquent-concerns/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

johnwhitley/separateeloquentconcerns
====================================

[](#johnwhitleyseparateeloquentconcerns)

> Automate Eloquent models to have a defined separate builder and collection per model.

Eloquent allows both set and individual entity methods to be defined on the model class: this is good for small projects and good to get started using Eloquent.

There are times when a model grows to an extent where separating the set (scope prefixed) function from the individual's functions (relationships, accessors, mutators, etc.) help the model stay a more manageable size. There are a number of possible solutions that would solve this; this project advocates putting what would normally be a "scope" prefixed function into a custom builder class - one custom builder per model.

This project assumes a strict namespace for models, collections and builders, so that where the model is in a directory "Model", the collection is in a sibling directory "Collection", and the eloquent builder in another directory "Builder".

Installing
----------

[](#installing)

```
composer require johnwhitley/separateeloquentconcerns
```

Using
-----

[](#using)

There are two options when using this model extention: to enforce the existance of the custom builder or collection; or to gracefully fall back to the default builder or collection.

To force the existance of a custom builder and a custom collection, add these traits to your model:

```
  use \Illuminate\Database\Eloquent\SeparateConcernsTrait, \Illuminate\Database\Eloquent\EnforcedSeparateBuilderTrait, \Illuminate\Database\Eloquent\EnforcedSeparateCollectionTrait;
```

To allow the existance of a custom builder and a custom collection, but fall back to the default builder or collection should they be absent; add these traits to your model:

```
  use \Illuminate\Database\Eloquent\SeparateConcernsTrait, \Illuminate\Database\Eloquent\OptionalSeparateBuilderTrait, \Illuminate\Database\Eloquent\OptionalSeparateCollectionTrait;
```

You may choose to use optional collection and enforced builder; or vise versa.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

3495d ago

### Community

Maintainers

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

---

Top Contributors

[![john-whitley](https://avatars.githubusercontent.com/u/7869527?v=4)](https://github.com/john-whitley "john-whitley (7 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/johnwhitley-seperate-eloquent-concerns/health.svg)

```
[![Health](https://phpackages.com/badges/johnwhitley-seperate-eloquent-concerns/health.svg)](https://phpackages.com/packages/johnwhitley-seperate-eloquent-concerns)
```

###  Alternatives

[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

17818.7k](/packages/markwalet-nova-modal-response)[crumbls/layup

A visual page builder plugin for Filament 5 — Divi-style grid layouts with extensible widgets.

591.7k1](/packages/crumbls-layup)[tomshaw/electricgrid

A feature-rich Livewire package designed for projects that require dynamic, interactive data tables.

119.2k](/packages/tomshaw-electricgrid)

PHPackages © 2026

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