wowe/laravel-eloquent-scopes
Larablocks Analysis
wowe/laravel-eloquent-scopes works with Laravel 5 (latest release v3.0.0, May 19, 2017), which reached end of life: no more fixes, even for security.
Laravel 4 in earlier releases.
Recommendation checks
Not advisedNot advised: no release or commit in over 2 years.
- No release or commit in over 2 years
- Supports only Laravel 5, past end of life
- No release in the last 12 months (last: May 19, 2017)
- 0 downloads a month (needs 10,000)
- 2 GitHub stars (needs 100)
State
Likely abandoned- No release or commit in over 2 years.
- Last stable release: May 19, 2017.
- No releases in the last 12 months.
- First released: Mar 2, 2015.
- 0 open issues on GitHub.
Data from Packagist and GitHub, checked by Larablocks on Nov 27, 2026.
| Install | |
|---|---|
composer require wowe/laravel-eloquent-scopes |
|
| Latest Version: | v3.0.0 |
| Laravel: | 5 |
| Older releases: | 4 |
| License: | MIT |
| Last Updated: | May 19, 2017 |
| Links: | GitHub · Packagist |
Scopes for Laravel Eloquent
This package includes some useful global scopes for Laravel Eloquent.
Installation
Traits
Usage
Release Notes
Version Compatibility
License
Installation
Via Composer
composer require wowe/laravel-eloquent-scopes
Traits
ActivatableTrait
When this trait is added to an Eloquent model, it will only return rows which have the active field set to true.
If you want to use a field with a different name than active, set a constant called ACTIVE on the Eloquent model to whichever name you would like to use.
The following methods are included with the trait:
deactivate: sets theactivefield tofalse.activate: sets theactivefield totrue.withInactive: will include all entries in results regardless of the value of theactivefield.onlyInactive: will include only those entries withactivefields set tofalse.
Usage
Add Trait to Model
Add the ActivatableTrait to an Eloquent model.
use Wowe\Eloquent\Scopes\ActivatableTrait;
class Test extends \Eloquent
{
use ActivatableTrait;
const ACTIVE = 'is_active';
}
Query Model
// Get all entries that are active
Test::all();
// Get a single entry only if active
Test::find(1);
// Get all entries
Test::withInactive()->get();
// Get all inactive entries
Test::inactiveOnly()->get();
Version Compatibility
| This Package | Laravel |
|---|---|
| 1.x.x | 4.2.x |
| 2.x.x | 5.0.x |
| 3.x.x | 5.1.x |
License
This package is open-sourced software licensed under the MIT license
Related Packages
A Laravel package to add possibility to use global scopes with an or operation i...
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| v3.0.0 | 5.1.* | MIT | ||
| v2.0.0 | >=5.4.0 | 5.0.* | MIT | |
| v1.0.0 | >=5.4.0 | 4.2.* | MIT |