Test Failed
Push — master ( a4b299...6cd9b3 )
by Gianluca
15:28
created
src/Http/Controllers/shop/ShopCartController.php 1 patch
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -25,10 +25,10 @@  discard block
 block discarded – undo
25 25
         if (is_null($checkElement)) {
26 26
             if($num_avaibile_product > 0){
27 27
                 return true;
28
-            }else{
28
+            } else{
29 29
                 return false;
30 30
             }
31
-        }else{
31
+        } else{
32 32
             //if there is something in the cart check the avaibility
33 33
             if ($checkElement->quantity + 1 <= $num_avaibile_product) {
34 34
                 return true;
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
                 session()->push('products.ids', $product_item_id);
51 51
                 session()->put('cart',self::getCountableCart(session('products.ids')));
52 52
                 return response()->json(session('cart'));
53
-            }else{
53
+            } else{
54 54
                 //if number i want is less than number avaible product i can add into cart
55 55
                 $mycart = Cart::where('product_item_id',$product->id)->where('user_id',Auth::user()->id)->first();
56 56
                 if(is_null($mycart)){
@@ -59,13 +59,13 @@  discard block
 block discarded – undo
59 59
                     $cart->product_item_id = $product_item_id;
60 60
                     $cart->quantity = 1;
61 61
                     $cart->save();
62
-                }else{
62
+                } else{
63 63
                     $mycart->quantity = $mycart->quantity + 1;
64 64
                     $mycart->save();
65 65
                 }
66 66
                 return true;
67 67
             }
68
-        }else{
68
+        } else{
69 69
             return response()->json([
70 70
                 'errors' => "Prodotto non disponibile o terminato",
71 71
             ], 422);
Please login to merge, or discard this patch.