@php
$productos = \App\Models\Product::with('images')
->select('products.*')
->leftJoin(DB::raw('(SELECT product_id, SUM(quantity) as total_vendidos FROM order_items GROUP BY product_id) as ventas'), 'products.id', '=', 'ventas.product_id')
->orderByDesc('ventas.total_vendidos')
//->limit(5)
->get();
$clienteAutenticado = session()->has('cliente_id');
@endphp
${{ number_format($producto->price, 2) }} {{ Str::limit($producto->description, 60) }}
@endif
{{ $producto->name }}