title: How to send data without refreshing page in laravel?
body: <p>I need send data to the database without refreshing page. </p>
  
  <p><strong>Home Blade :</strong></p>
  
  <pre><code>&lt;form class="chat" id="message" action="#" method="post"&gt;
      &lt;input type="hidden" name="_token" id="_token" value="{{ csrf_token() }}"&gt;
      &lt;li&gt;
          &lt;div class="panel-footer"&gt;
              &lt;div class="input-group"&gt;
                  &lt;input type="text" name="message" class="" placeholder="Type your message here..." /&gt;
                  &lt;span class="input-group-btn"&gt;
                      &lt;button type="submit" class=" btn-success btn-sm searchButton" id="save" &gt;
                      Send
                      &lt;/button&gt;
                  &lt;/span&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/li&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>Controller :</strong></p>
  
  <pre><code>public function message(Request $data)
  {
      $ins = $data-&gt;all();
      unset($ins['_token']);
      $store = DB::table("chatbox")-&gt;insert([$ins]);
      return Redirect('Users/home')-&gt;with('message',"success");
  }
  </code></pre>
  
  <p><strong>Ajax :</strong></p>
  
  <pre><code>&lt;script&gt;
  $(document).on("click", ".save", function() {
      $.ajax({
          type: "post",
          url: '/Users/message',
          data: $(".message").serialize(),
          success: function(store) {
  
          },
          error: function() {
          }
      });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>At present when I send data it is automatically refreshing the whole page but only the particular form need to be refreshed.</p>