forge/app/Models/Scopes/DisabledScope.php
Refringe c59615d7ac
Updates, Lots of Updates
No one reads these anyways. I updated a lot. There. Happy?
2024-05-31 17:44:52 -04:00

19 lines
415 B
PHP

<?php
namespace App\Models\Scopes;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Scope;
class DisabledScope implements Scope
{
/**
* Apply the scope to a given Eloquent query builder.
*/
public function apply(Builder $builder, Model $model): void
{
$builder->where($model->getTable().'.disabled', false);
}
}