details); dd($dets); $currentPage = LengthAwarePaginator::resolveCurrentPage(); // Create a new Laravel collection from the array data $itemCollection = collect($dets); // Define how many items we want to be visible in each page $perPage = 10; // Slice the collection to get the items to display in current page $currentPageItems = $itemCollection->slice(($currentPage * $perPage) - $perPage, $perPage)->all(); // Create our paginator and pass it to the view $paginatedItems= new LengthAwarePaginator($currentPageItems , count($itemCollection), $perPage); // set url path for generted links $paginatedItems->setPath($request->url()); //******************************************** // $data= public_path("422019_093407_Articles.xml"); // // $test= simplexml_load_file($data); // // return response()->json($test,200); // foreach($dets as $d){ $article = Article::find($d->article_id); $d->article_id = $article->nom; } return view('mattine.detailsvente.index', ['ventes' => $paginatedItems,'sortiestock'=>$sortiestockes, 'store' => $store, 'vente' => $vente]); } }