title: Laravel append data after success ajax
body: <p>I have this div:</p>
  
  <pre><code>@foreach($bids as $b)
  &lt;div class="bids notice notice-lg"&gt;
      &lt;strong&gt;{{$b-&gt;user-&gt;name}}&lt;/strong&gt; siūlo &lt;span style="font-size: 18px" class="label label-success"&gt;{{$b-&gt;bid}} €&lt;/span&gt;
  &lt;/div&gt;
  @endforeach
  </code></pre>
  
  <p>And this is my AJAX:</p>
  
  <pre><code>$(function(){
  
  $('#placeBid').on('submit',function(e){
      $.ajaxSetup({
          headers: {
              'X-CSRF-Token': $('meta[name="csrf_token"]').attr('content')
          }
      });
      e.preventDefault(e);
  
          if($("#jsBidPrice").val() &lt;= $(".minBid").val()){
  
          $.ajax({
  
          method:"POST",
          url: $("#placeBid").attr("action"),
          data:$(this).serialize(),
          dataType: 'text',
          success: function(data){  
             $('.minBid').val(0);
             $("#bidSubmit").attr("disabled", true);
  
          },
          error: function(data){
              console.log("request failed");
          }
      })
      }
          else {
              alert('Too low.');
          }
      });
  });
  </code></pre>
  
  <p>How can I append my div #bids with new submitted data ? This is what I'm trying to right now - I'm trying to create new DIV and place it in foreach value. Like this: </p>
  
  <pre><code>var html = '&lt;strong&gt;{{$b-&gt;user-&gt;name}}&lt;/strong&gt;';
  html += 'siūlo &lt;span style="font-size: 18px" class="label label-success"&gt;';
  html += '54044 €&lt;/span&gt;';
  
  $('.bidsA').append(html);
  </code></pre>
  
  <p>And I place this div over the bids div. So the HTML looks like this:</p>
  
  <pre><code>@foreach($bids as $b)
  
  &lt;div class="bidsA notice notice-lg"&gt;
  &lt;/div&gt;
  
  
  &lt;div class="bids notice notice-lg"&gt;
  
      &lt;strong&gt;{{$b-&gt;user-&gt;name}}&lt;/strong&gt;siūlo &lt;span style="font-size: 18px" class="label label-success"&gt;{{$b-&gt;bid}} €&lt;/span&gt;
  
  &lt;/div&gt;
  @endforeach
  </code></pre>
  
  <p>And of course I get <code>undefined variable $b</code> how should I correctly include it from AJAX to HTML ?</p>
  
  <p><strong>EDIT</strong></p>
  
  <pre><code>public function store(BidRequest $request, $id)
  {   
  
       $product = Product::where('id', $id)-&gt;first();
       $bid = new Bid([
          'product_id' =&gt; $product-&gt;id,
          'bid'   =&gt; $request-&gt;bid,
       ]);
  
       Auth::user()-&gt;bid()-&gt;save($bid);
  
      }
  }
  </code></pre>