Answers for "filter collection (laravel)"

1

filter collection (laravel)

$itemCollection = collect($contacts);
$filtered = $itemCollection->filter(function($item) use ($search) {
    return stripos($item['username'],$search) !== false;
});
Posted by: Guest on June-12-2021

Code answers related to "filter collection (laravel)"

Browse Popular Code Answers by Language