I cannot find the way to display random results from a collection in laravel mysql. My query:
public function getTabletsProducts()
{
return DB::table('products')
->orderBy('created_at')
->where('categoryName', 'All Tablets')
->where('sellingPrice', '<', 1000)
->take(6)
->orderByRaw("RAND()")
->get();
}