Я хочу, чтобы код выбирал 10 случайных продуктов и отображал их предпочтительно с использованием foreach

Код: Выделить всё
Trending Products
@foreach($latests as $product)
{{csrf_field()}}
@if(Session::has('uniqueid'))
@else
@endif
[/i]
[url={{url(]id}}/{{$product->title}}"> [i]feature_image}}&w=700&h=443" alt="Product Image">
{{$product->title}}[/url]
{{ substr(str_replace(' ', ' ', strip_tags($product->description)), 0, 600)}}
[list]
[*][/i]{{$product->price}}
@if($product->rocketdelivery == 'yes')
[*]
[i]
@else
[*]
@endif
[/list]
@if($product->bylocal == 'yes')
[img]{{ URL::asset([/img]
@endif
id)}}%">
{{csrf_field()}}
@if(Session::has('uniqueid'))
@else
@endif
@if($product->stock != 0 || $product->stock === null )
[/i] {{$language->add_to_cart}}
@else
[i][/i] {{$language->out_of_stock}}
@endif
@endforeach
Подробнее здесь: https://stackoverflow.com/questions/676 ... e-in-mysql
Мобильная версия