2019-07-11 11:45:47 +02:00
|
|
|
<?php
|
2022-04-19 16:07:27 +02:00
|
|
|
|
2019-07-11 11:45:47 +02:00
|
|
|
namespace App\Scopes;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Scope;
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
use Illuminate\Database\Eloquent\Builder;
|
|
|
|
|
|
|
|
|
|
class SystemScope implements Scope
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Apply the scope to a given Eloquent query builder.
|
|
|
|
|
*
|
2022-04-19 16:07:27 +02:00
|
|
|
* @param \Illuminate\Database\Eloquent\Builder $builder
|
|
|
|
|
* @param \Illuminate\Database\Eloquent\Model $model
|
2019-07-11 11:45:47 +02:00
|
|
|
* @return void
|
2022-06-20 14:57:58 +02:00
|
|
|
* @phpcs:disable Generic.CodeAnalysis.UnusedFunctionParameter.FoundInImplementedInterfaceAfterLastUsed
|
2019-07-11 11:45:47 +02:00
|
|
|
*/
|
|
|
|
|
public function apply(Builder $builder, Model $model)
|
|
|
|
|
{
|
2022-06-20 14:57:58 +02:00
|
|
|
// phpcs:enable
|
2022-04-19 16:07:27 +02:00
|
|
|
$builder->where('system', false);
|
2019-07-11 11:45:47 +02:00
|
|
|
}
|
2022-04-19 16:07:27 +02:00
|
|
|
}
|