clrghouz/app/Traits/ScopeActive.php
2021-06-13 01:32:22 +10:00

18 lines
236 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($this->getTable().'.active',TRUE);
}
}