Level 16
Nobody?
Hi, I want to know how to treat every 5th row different in pagination. I have a $ads variable that keeps all ads with a active value of 1 in a pagination. Then I have another variable $business that keeps all ads with a active value of 2 in a pagination.
My problem is that I don't know how to specify that I want 4 normal ads listed and then 4 business ads and then 4 normal ads and so on.
public function category($category)
{
$ads = $this->adRepo->getUsingCategory($category); // Returns LengthAwarePaginator
$business = $this->adRepo->business($ads->count()); // Returns LengthAwarePaginator
return view('search.category', compact('ads', 'business'));
}
@foreach($ads as $ad)
// show 4 normal ads
// After those show 4 business ads
@endforeach
How can this be done?
Please or to participate in this conversation.