@@ -119,7 +119,11 @@ public function store(StoreRequest $request)
119
119
120
120
return $ this ->withSuccess ($ request , [
121
121
'message ' => __ ('Added to Cart ' ),
122
- 'cart ' => $ cart ->fresh ()->toAugmentedArray (),
122
+ 'cart ' => $ this ->getCart ()
123
+ ->toAugmentedCollection ()
124
+ ->withRelations (['customer ' , 'customer_id ' ])
125
+ ->withShallowNesting ()
126
+ ->toArray (),
123
127
]);
124
128
}
125
129
@@ -163,7 +167,11 @@ public function update(UpdateRequest $request, string $requestItem)
163
167
164
168
return $ this ->withSuccess ($ request , [
165
169
'message ' => __ ('Line Item Updated ' ),
166
- 'cart ' => $ cart ->toAugmentedArray (),
170
+ 'cart ' => $ this ->getCart ()
171
+ ->toAugmentedCollection ()
172
+ ->withRelations (['customer ' , 'customer_id ' ])
173
+ ->withShallowNesting ()
174
+ ->toArray (),
167
175
]);
168
176
}
169
177
@@ -175,7 +183,11 @@ public function destroy(DestroyRequest $request, string $item)
175
183
176
184
return $ this ->withSuccess ($ request , [
177
185
'message ' => __ ('Item Removed from Cart ' ),
178
- 'cart ' => $ cart ->toAugmentedArray (),
186
+ 'cart ' => $ this ->getCart ()
187
+ ->toAugmentedCollection ()
188
+ ->withRelations (['customer ' , 'customer_id ' ])
189
+ ->withShallowNesting ()
190
+ ->toArray (),
179
191
]);
180
192
}
181
193
0 commit comments