PHPackages                             beyondcode/laravel-scope-checks - 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. beyondcode/laravel-scope-checks

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

beyondcode/laravel-scope-checks
===============================

Automatically convert your Eloquent scopes to boolean check methods.

1.0.0(6y ago)78114[1 issues](https://github.com/beyondcode/laravel-scope-checks/issues)MITPHPPHP ^7.2

Since Feb 6Pushed 6y ago3 watchersCompare

[ Source](https://github.com/beyondcode/laravel-scope-checks)[ Packagist](https://packagist.org/packages/beyondcode/laravel-scope-checks)[ Docs](https://github.com/beyondcode/laravel-scope-checks)[ RSS](/packages/beyondcode-laravel-scope-checks/feed)WikiDiscussions master Synced today

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

Laravel Scope Checks
====================

[](#laravel-scope-checks)

Automatically convert your Eloquent scopes to boolean check methods.

[![Latest Version on Packagist](https://camo.githubusercontent.com/b1db0ce2df40c6ccac96326bbca53f8a84d1054b173cee43bb34f3fa33b7d501/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6265796f6e64636f64652f6c61726176656c2d73636f70652d636865636b732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/beyondcode/laravel-scope-checks)[![Build Status](https://camo.githubusercontent.com/de4ad27908bce7df99a951aab14bf21b4a181c3edbc53a3f49bd63a9199b13cb/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6265796f6e64636f64652f6c61726176656c2d73636f70652d636865636b732f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/beyondcode/laravel-scope-checks)[![Quality Score](https://camo.githubusercontent.com/6efd1a91c4f1ec45747c7e5ea29859c2e074682f57c25ae35a526333606638a8/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6265796f6e64636f64652f6c61726176656c2d73636f70652d636865636b732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/beyondcode/laravel-scope-checks)[![Total Downloads](https://camo.githubusercontent.com/db3be652452d6a082d30d05b95068386c121f4344d75e1a212c22ffb58bde524/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6265796f6e64636f64652f6c61726176656c2d73636f70652d636865636b732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/beyondcode/laravel-scope-checks)

This package allows you to automatically call all your eloquent model scope methods as checks.

```
class User extends Model
{
    use HasScopeChecks;

    public function scopeActive($query)
    {
        $query->where('active', true);
    }

    public function scopeActive($query)
    {
        return $query->where('active', 1);
    }
}

// Now you can call your scope check using:
$user->isActive();
```

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

[](#installation)

You can install the package via composer:

```
composer require beyondcode/laravel-scope-checks
```

Usage
-----

[](#usage)

All you need to do to be able to call your scopes as check methods is add the `HasScopeChecks` trait to your eloquent model.

```
use \BeyondCode\LaravelScopeChecks\HasScopeChecks;

class Post {
    use HasScopeChecks;

    public function scopePublished($query)
    {
        return $query->where('active', 1);
    }

    public function scopeMinimumRating($query, $rating = 5)
    {
        return $query->where('rating', '>=', $rating);
    }
}
```

You can either call your check methods using the `is` or the `has` naming prefix on your model instances. For example:

```
$post->isPublished();
$post->hasMinimumRating();
```

When you make use of dynamic scopes (like the `scopeRating` method), you can also pass the additional scope parameters to the check methods:

```
$post->isMinimumRating(1);
$post->hasMinimumRating(1);
```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on 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)

- [Marcel Pociot](https://github.com/mpociot)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity51

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

2284d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/863e91ca13b8c4031f202c0eee4f06b3a4352f92cf9cd397b03609b20247ed16?d=identicon)[beyondcode](/maintainers/beyondcode)

---

Top Contributors

[![mpociot](https://avatars.githubusercontent.com/u/804684?v=4)](https://github.com/mpociot "mpociot (3 commits)")

---

Tags

beyondcodelaravel-scope-checks

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/beyondcode-laravel-scope-checks/health.svg)

```
[![Health](https://phpackages.com/badges/beyondcode-laravel-scope-checks/health.svg)](https://phpackages.com/packages/beyondcode-laravel-scope-checks)
```

###  Alternatives

[beyondcode/laravel-comments

Add comments to your Laravel application

605414.2k2](/packages/beyondcode-laravel-comments)[beyondcode/laravel-favicon

Create dynamic favicons based on your environment settings.

37345.5k](/packages/beyondcode-laravel-favicon)[beyondcode/laravel-vouchers

Allow users to redeem vouchers that are bound to models..

70763.4k2](/packages/beyondcode-laravel-vouchers)[beyondcode/tinkerwell

Drivers, panels and tools for customizing Tinkerwell to your application.

4313.7k2](/packages/beyondcode-tinkerwell)

PHPackages © 2026

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