laravel - blade templates layout structure add row-fluid for each 4 spans

限于喜欢 提交于 2019-12-03 20:19:22

You could use array_chunk on $courses->all() to split it in groups of 4, and make a nested @foreach. Something like this:

@foreach (array_chunk($courses->all(), 4) as $courseRow)
    <div class="row-fluid">
        @foreach ($courseRow as $course)
            <div class="span3 learn">...</div>
        @endforeach
    </div>
@endforeach
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!