|
@@ -174,12 +174,11 @@ class OrderController extends Controller
|
|
|
unset($data['products']);
|
|
unset($data['products']);
|
|
|
|
|
|
|
|
if(isset($data['id'])) {
|
|
if(isset($data['id'])) {
|
|
|
- Order::query()->where('id', $data['id'])->update($data);
|
|
|
|
|
|
|
+ $order = Order::query()->where('id', $data['id'])->update($data);
|
|
|
} else {
|
|
} else {
|
|
|
- Order::query()->create($data);
|
|
|
|
|
|
|
+ $order = Order::query()->create($data);
|
|
|
}
|
|
}
|
|
|
if($products) {
|
|
if($products) {
|
|
|
- $order = Order::query()->where('id', $data['id'])->first();
|
|
|
|
|
$order->products()->sync($products);
|
|
$order->products()->sync($products);
|
|
|
}
|
|
}
|
|
|
|
|
|