PHPackages                             daniel-de-wit/laravel-model-active - 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. daniel-de-wit/laravel-model-active

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

daniel-de-wit/laravel-model-active
==================================

Simple trait for scoping Eloquent models by 'active' boolean

1.0.0(8y ago)06.1kMITPHP

Since Oct 23Pushed 5y ago2 watchersCompare

[ Source](https://github.com/daniel-de-wit/laravel-model-active)[ Packagist](https://packagist.org/packages/daniel-de-wit/laravel-model-active)[ Docs](https://github.com/daniel-de-wit/laravel-model-active)[ RSS](/packages/daniel-de-wit-laravel-model-active/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (0)

laravel-model-active
====================

[](#laravel-model-active)

A trait for Laravel to only pull models marked as "active". When the trait is applied to a model, the queries will, by default, only find rows for that model where the active column has a value of 1.

Requirements
============

[](#requirements)

- Laravel ^5.2

Installation
============

[](#installation)

Add package to composer.json

`composer require daniel-de-wit/laravel-model-active`

Usage
=====

[](#usage)

Add `active` boolean to Eloquent Model:

```
