$category = Auto::all()->map(function($item){
if( ((Auto::where('pid', '=',$item->c_id_group)->count()))>0){
$item->chil=1;
}
return $item;
});
$currentPage = \Illuminate\Pagination\Paginator::resolveCurrentPage();
$prePage = 60;
$category = new \Illuminate\Pagination\LengthAwarePaginator(
$category->forPage($currentPage, $prePage), $category->count(), $prePage, $currentPage
);
$category=Auto::all()->map(function($item){
if( ((Auto::where('pid', '=',$item->c_id_group)->count()))>0){
$item->chil=1;
}else{
$item->chil=0;
}
return ($item);
});
$category= new \Illuminate\Database\Eloquent\Collection($category);
{{ $category->paginate(60) }}
@forelse($category as $categoryes)
@if($categoryes->pid == null)
{{$categoryes->name_group}}
@endif
@empty
<p></p>
@endforelse
<div align="center"><?php echo $category->render(); ?></div>
$fi = Item::where
('name_item', 'LIKE', '%'.$request->find.'%')
->get();