This commit is contained in:
tanch0
2024-05-08 14:02:40 +05:45
parent cc991bb0e1
commit 9fa6a5d797
9 changed files with 1681 additions and 97 deletions

View File

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