Laravel blade pagenation avtive not working

pagentation تعمل بشكل جيد ,يجد المشكل في توافق ترقيم صفحة (page= 2)url? مع ترقيم تصفح البوتستراب (active)

pagentation تعمل بشكل جيد ,يجد المشكل في توافق ترقيم صفحة (page= 2)url? مع ترقيم تصفح البوتستراب (active)

<-- blade page --!>
{{ $annonceur->appends(Request::except('page'))->render() }}
<-- controller--!>
$total = $annonceur_with_logo->total() + $annonceur_without_logo->total();
     $merged = $annonceur_with_logo->merge($annonceur_without_logo);
     $itemscollection = collect($merged)->unique();
     $currentPage = \Illuminate\Pagination\LengthAwarePaginator::resolveCurrentPage($itemscollection);
    $count = count($currentPage) == 0 ? 1 : count($itemscollection); 
    $page = new \Illuminate\Pagination\LengthAwarePaginator($itemscollection, $total , $count , $currentPage);

    $annonceur = $page->setPath(route('resultAnnonceurs',$text));

1 التعليقات


  • harry diane
    harry diane 2017-12-26 14:51:45

    i found the error

    //its should be 
     $currentPage = \Illuminate\Pagination\LengthAwarePaginator::resolveCurrentPage(); 
    //not 
         $currentPage = \Illuminate\Pagination\LengthAwarePaginator::resolveCurrentPage($itemscollection);

اضف تعليق


يجب ان يكون لديك حساب في الموقع تسجيل الدخول او تسجيل عضوية جديدة

خدمات ويب الفريق