Is there a way split the results of an eloquent search when using it in blade? I ask as I have a bootstrap carousel which is 2 slides split into 3 columns in each slide. I would like to have it so that each slide is filled out with the results of the following search:
$alsoBought = Game::where('category_id', $showGames['category_id'])->paginate(6);
As you can see, it brings back 6 results. Is there a way to split it so that there's 3 results on each slide? Here's my slide code:
<div id="carouselExampleSlidesOnly" class="carousel slide" data-ride="carousel">
<div class="carousel-inner">
<div class="carousel-item active">
<div class="row">
@foreach($alsoBought->take(3) as $bought)
<div class="col-4"><img class="w-100" src="{{ $bought['image'] }}" alt="First slide"></div>
@endforeach
</div>
</div>
<div class="carousel-item">
<div class="row">
@foreach($alsoBought as $bought)
<div class="col-4"><img class="w-100" src="{{ $bought['image'] }}" alt="First slide"></div>
@endforeach
</div>
</div>
</div>
</div>