SystemConfigFilter.php
753 Bytes
<?php
namespace App\ModelFilters;
use App\Support\ModelFilter;
use Arr;
class SystemConfigFilter extends ModelFilter
{
/**
* @param array|int $parent
* @return void
*/
public function parent(array|int $parent): void
{
$this->whereIn('parent_id', Arr::wrap($parent));
}
/**
* @param array|string $key
* @return void
*/
public function parentKey(array|string $key): void
{
$this->whereHas('parent', fn($query) => $query->whereIn('identifier', Arr::wrap($key)));
}
/**
* @param string $identifier
* @return void
*/
public function identifier(array|string $identifier): void
{
$this->whereIn('identifier', Arr::wrap($identifier));
}
}