PHPackages                             sfneal/scopes - 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. sfneal/scopes

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

sfneal/scopes
=============

Add custom constraints to all queries performed on an Eloquent Model.

2.1.1(2y ago)063.5k[3 PRs](https://github.com/sfneal/scopes/pulls)3MITPHPPHP ^8.0|^8.1|^8.2|^8.3CI passing

Since Aug 14Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/sfneal/scopes)[ Packagist](https://packagist.org/packages/sfneal/scopes)[ Docs](https://github.com/sfneal/scopes)[ RSS](/packages/sfneal-scopes/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (10)Dependencies (6)Versions (16)Used By (3)

Scopes
======

[](#scopes)

[![Packagist PHP support](https://camo.githubusercontent.com/6c4193889c543eb44e5e1b71d677d92f836657fffa3b68956b0d1747f93d0e91/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f73666e65616c2f73636f706573)](https://packagist.org/packages/sfneal/scopes)[![Latest Version on Packagist](https://camo.githubusercontent.com/0cfd0851e4f0fd6ddc03ba00c895f57a65e9b8c8f135de6dd2a447e0502ae24c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f73666e65616c2f73636f7065732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sfneal/scopes)[![Build Status](https://camo.githubusercontent.com/387a3335f833a956efc43fa090b1640e4909a8bbeac381a11050d7b0b164b228/68747470733a2f2f7472617669732d63692e636f6d2f73666e65616c2f73636f7065732e7376673f6272616e63683d6d6173746572267374796c653d666c61742d737175617265)](https://travis-ci.com/sfneal/scopes)[![Quality Score](https://camo.githubusercontent.com/e9f2d0cefc8dd496e691ed044a57107cea29783096c5360f2babe61a526f24d7/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f73666e65616c2f73636f7065732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/sfneal/scopes)[![Total Downloads](https://camo.githubusercontent.com/2afc67a5411abfa2adbf1e8ab34632c79b47374cd5ba910ccabdaacfaa3fa28a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73666e65616c2f73636f7065732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/sfneal/scopes)

Add custom constraints to all queries performed on an Eloquent Model

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

[](#installation)

You can install the package via composer:

```
composer require sfneal/scopes
```

Usage
-----

[](#usage)

```
// Usage description here
```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Stephen Neal](https://github.com/sfneal)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

PHP Package Boilerplate
-----------------------

[](#php-package-boilerplate)

This package was generated using the [PHP Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

45

—

FairBetter than 93% of packages

Maintenance52

Moderate activity, may be stable

Popularity23

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity77

Established project with proven stability

 Bus Factor1

Top contributor holds 89.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 ~124 days

Recently: every ~264 days

Total

12

Last Release

738d ago

Major Versions

0.4.2 → 1.0.02021-02-01

1.0.2 → 2.0.02024-04-16

PHP version history (6 changes)0.1.0PHP ^7.1

0.2.0PHP ^7.2

0.3.0PHP ^7.0

0.4.0PHP &gt;=7.0

1.0.0PHP &gt;=7.3

2.0.0PHP ^8.0|^8.1|^8.2|^8.3

### Community

Maintainers

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

---

Top Contributors

[![sfneal](https://avatars.githubusercontent.com/u/23200215?v=4)](https://github.com/sfneal "sfneal (53 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (6 commits)")

---

Tags

scopessfneal

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sfneal-scopes/health.svg)

```
[![Health](https://phpackages.com/badges/sfneal-scopes/health.svg)](https://phpackages.com/packages/sfneal-scopes)
```

###  Alternatives

[anourvalar/eloquent-serialize

Laravel Query Builder (Eloquent) serialization

11320.2M21](/packages/anourvalar-eloquent-serialize)[statamic-rad-pack/runway

Eloquently manage your database models in Statamic.

135192.6k5](/packages/statamic-rad-pack-runway)[cybercog/laravel-eloquent-flag

Laravel Eloquent boolean &amp; timestamp flagged attributes behavior.

13518.7k](/packages/cybercog-laravel-eloquent-flag)

PHPackages © 2026

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