Download the PHP package wowe/laravel-eloquent-scopes without Composer
On this page you can find all versions of the php package wowe/laravel-eloquent-scopes. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download wowe/laravel-eloquent-scopes
More information about wowe/laravel-eloquent-scopes
Files in wowe/laravel-eloquent-scopes
Package laravel-eloquent-scopes
Short Description Some general scopes for Eloquent
License MIT
Homepage https://github.com/willrowe/laravel-eloquent-scopes
Informations about the package laravel-eloquent-scopes
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
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 theactive
field tofalse
.activate
: sets theactive
field totrue
.withInactive
: will include all entries in results regardless of the value of theactive
field.onlyInactive
: will include only those entries withactive
fields set tofalse
.
Usage
Add Trait to Model
Add the ActivatableTrait
to an Eloquent model.
Query Model
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