mgsmus
$data['products'] = $products->select([
'id', 'name', 'image', 'commission', 'price',
'buy_now', 'type', 'short_desc', 'pricing_desc',
'offer_status', 'period_status', 'period', 'period_frequency',
'endpoint', 'product_type', 'unique_id', 'discount_show_status',
'annual_payment', 'pre_register', 'privacy_status', 'privacy',
'sg_project', 'last_pre_register_date', 'product_desc',
'product_consulting', 'product_status',
])->get()->toArray();
$products = $data['products'];
return collect($products)->map(function ($product) {
$product['prices'] = collect($product['prices'])->map(function ($item) {
unset($item['product']);
return $item;
});
return $product;
});
Bu şekilde düzeldi abi