clrghouz/app/Traits/ScopeActive.php

18 lines
236 B
PHP
Raw Normal View History

<?php
/**
* Add a ScopeActive to an Eloquent Model
*/
namespace App\Traits;
trait ScopeActive
{
/**
* Only query active records
*/
public function scopeActive()
{
2021-04-01 10:59:15 +00:00
return $this->where($this->getTable().'.active',TRUE);
}
}