title: auto refresh div only when data is changed in laravel-8
body: <p>I can auto-refresh the page every 5 seconds using this code</p>
  <pre><code>?php
  $page = $_SERVER['PHP_SELF'];
  $sec = &quot;10&quot;;
  ?&gt;
  &lt;html&gt;
      &lt;head&gt;
      &lt;meta http-equiv=&quot;refresh&quot; content=&quot;&lt;?php echo $sec?&gt;;URL='&lt;?php echo $page?&gt;'&quot;&gt;
      &lt;/head&gt;
      &lt;body&gt;
        &lt;div id=&quot;auto_refresh&quot;&gt;
          &lt;table id=&quot;example1&quot; class=&quot;table table-bordered table-striped table-sm&quot;&gt;
              &lt;thead&gt;
                  &lt;tr&gt;
                      &lt;th&gt;SL&lt;/th&gt;
                      &lt;th&gt;Match Name&lt;/th&gt;
                      &lt;th&gt;Team Name&lt;/th&gt;
                  &lt;/tr&gt;
              &lt;/thead&gt;
              &lt;tbody&gt;
                  @foreach ($databowlersecond as $key =&gt; $row)
                      &lt;tr&gt;
                          &lt;td&gt;{{ $key + 1 }}&lt;/td&gt;
                          &lt;td&gt;{{ $row-&gt;matchh-&gt;match_name }}&lt;/td&gt;
                          &lt;td&gt;{{ $row-&gt;team-&gt;team_name }}&lt;/td&gt;
                      &lt;/tr&gt;
                  @endforeach
              &lt;/tbody&gt;
          &lt;/table&gt;
        &lt;/div&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  <p>But I want auto-refresh my div when data is updated how to do this?</p>