protected static function getItems(string $search = null)
{
$items = [
'foo',
'bar',
];
return collect($items)
->filter(function ($item) use ($search) {
if (blank($search)) {
return true;
}
return Str::contains($item, $search);
})
->toArray();
}
protected static function getItems(string $search = null)
{
$items = [
'foo',
'bar',
];
return collect($items)
->filter(function ($item) use ($search) {
if (blank($search)) {
return true;
}
return Str::contains($item, $search);
})
->toArray();
}