title: How to solve error Undefined index in php (laravel)
body: <p>I am sending arrays from View to Controller using Post Method. This is my code.</p>
  
  <p>Controller:      <code>Session::put('isCheck', $isCheck);</code></p>
  
  <p>this is how i am assigning value to isChecked array.</p>
  
  <pre><code>   var isChecked = [
      &lt;?php
      $isCheck = "";
      if (Session::has('isCheck')) {
          $isCheck = Session::get('isCheck');
      }
      foreach ($isCheck as $isCheck) {
          $status = $isCheck;
          ?&gt;
          &lt;?php echo $status; ?&gt;,
      &lt;?php } ?&gt;
     ];
  </code></pre>
  
  <p>View:</p>
  
  <pre><code>  $("#target").click(function () {
                      var postTo = '&lt;?php echo action('sample@postView'); ?&gt;';
                      var data = {
                          isChecked: isChecked,
                          duplicateIsChecked: duplicateIsChecked
                      };
                      jQuery.post(postTo, data,
                              function (data) {
                                  alert(data);
  
                              });
                  });
  </code></pre>
  
  <p>isChecked and DuplicateIsChecked are my 2arrays.</p>
  
  <p>In controller I am writing this code:</p>
  
  <pre><code> $duplicateIsChecked = $_POST['duplicateIsChecked'];
   $isCheck = $_POST['isChecked'];
  </code></pre>
  
  <p>But i am getting Undefined index duplicateIsChecked error. Help me</p>