title: Multiple Laravel else
body: <p>I have a if statement but i need multiple else.</p>
  
  <p>here is my controller code</p>
  
  <pre><code>if (Input::get('productName') == "0" &amp;&amp; Input::get('orderCode') == "") {
          $productCode = Input::get('productCode');
  
          $productName = westcoproduct::where('productCode', $productCode)-&gt;first()-&gt;productName;
          $productPrice = westcoproduct::where('productCode', $productCode)-&gt;first()-&gt;price;
  
          $order = new westcoorderitem;
          $order-&gt;productName = $productName;
          $order-&gt;productCode = $productCode;
          $order-&gt;price = $productPrice;
          $order-&gt;quantity = Input::get('quantity');
          $order-&gt;westcoorder_id = Input::get('westcoorder_id');
          $order-&gt;save();
      } else {
          $productName = Input::get('productName');
  
          $productCode = westcoproduct::where('productName', $productName)-&gt;first()-&gt;productCode;
          $productPrice = westcoproduct::where('productName', $productName)-&gt;first()-&gt;price;
  
          $order = new westcoorderitem;
          $order-&gt;productName = $productName;
          $order-&gt;productCode = $productCode;
          $order-&gt;price = $productPrice;
          $order-&gt;quantity = Input::get('quantity');
          $order-&gt;westcoorder_id = Input::get('westcoorder_id');
          $order-&gt;save();
      } if(Input::get('productName') == "0" &amp;&amp; Input::get('productCode') == "0") {
          $orderCode = Input::get('orderCode');
  
          $productName = westcoproduct::where('orderCode', $orderCode)-&gt;first()-&gt;productName;
          $productCode = westcoproduct::where('orderCode', $orderCode)-&gt;first()-&gt;productCode;
          $productPrice = westcoproduct::where('orderCode', $orderCode)-&gt;first()-&gt;price;
  
          $order = new westcoorderitem;
          $order-&gt;productName = $productName;
          $order-&gt;productCode = $productCode;
          $order-&gt;price = $productPrice;
          $order-&gt;quantity = Input::get('quantity');
          $order-&gt;westcoorder_id = Input::get('westcoorder_id');
          $order-&gt;save();
      }
  </code></pre>
  
  <p>I have 3 input fields productName, productCode, orderCode. And this above should work if Only one of the feilds work. if the productname field is filled it works. but i cannot figure out how to get the other two to work.</p>
  
  <p>So with the orderCode productName and productCode will be empty and vise versa  </p>