$itemCollection = collect($contacts);
$filtered = $itemCollection->filter(function($item) use ($search) {
return stripos($item['username'],$search) !== false;
});
$routes = collect(Route::getRoutes()->getRoutesByName());
$serach = $routes->filter(function ($route) {
return Str::contains($route->getName(), "admin.");
});
dd($serach);
$collection = collect([2, 4, 6, 8]);
$collection->search(4);
// 1