products->list( filters: new ProductFilters(collectionId: $collection->id), perPage: $perPage, page: $page, )->through(fn (array $product) => [ 'name' => $product['name'], 'price' => $product['price'], 'image' => $product['media'][0]['url'] ?? null, 'href' => route('product.show', ['id' => $product['id']]), ]); return view('category.show', [ 'collection' => $collection, 'products' => $products, ]); } }