18 lines
217 B
PHP
18 lines
217 B
PHP
|
<?php
|
||
|
|
||
|
/**
|
||
|
* Add a ScopeActive to an Eloquent Model
|
||
|
*/
|
||
|
namespace App\Traits;
|
||
|
|
||
|
trait ScopeActive
|
||
|
{
|
||
|
/**
|
||
|
* Only query active records
|
||
|
*/
|
||
|
public function scopeActive()
|
||
|
{
|
||
|
return $this->where('active',TRUE);
|
||
|
}
|
||
|
}
|