title: How to reload Laravel @includes with AJAX?
body: <p>I've got a single page application inside of my larger application that will send data to the DB, and will also display that same table's data. Currently, I have AJAX dynamically sending the data. However, to get the data just inserted to appear in the table that I want it to, I have to refresh. I've been trying things all morning, but below is the current state of things. </p>
  
  <p>The View:</p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
      &lt;!--I took some stuff out to make it easier to look at --&gt;
    &lt;/head&gt;
    &lt;body onresize="resizeRecalc()"&gt;
      &lt;div class="container-fluid"&gt;
        &lt;div class="row header"&gt;
          &lt;div class="col-12"&gt;
            &lt;img src="{{ URL::asset('images/takeStatsLogo.png') }}" id="header-logo" /&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="mainArea row"&gt;
          &lt;div class="left col-8"&gt;
            &lt;div onclick="playPause()" class="embed-responsive embed-responsive-16by9"&gt;
              &lt;video id="gameFilm" src="{{ URL::asset('images/basketball.mp4') }}" preload="metadata"&gt;&lt;/video&gt;
            &lt;/div&gt;
  
            &lt;div class="timebar"&gt;
              &lt;span class="timeItem" id="timestamp"&gt;&lt;/span&gt;
              &lt;div onclick="changeVidTime()" onmousemove="moveLine(event)" onmouseout="REmoveLine()" id="outerBox"&gt; &lt;div id="progressBox"&gt; &lt;div id="placeMarker"&gt;
                  &lt;/div&gt;&lt;/div&gt;&lt;/div&gt;
              &lt;span class="timeItem" id="duration-place"&gt;&lt;/span&gt;
            &lt;/div&gt;
  
            &lt;!-- This is a key part --&gt;
            &lt;div id="statList"&gt;
                @include('partials.statList')
            &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;div id="right" class="right col-4"&gt;
            &lt;!--Checking if we should make the user select starters. If we have them, no need to do that...--&gt;
            @if ($game-&gt;starters != null)
                @include('partials.areStarters')
            @else
                @include('partials.noStarters')
            @endif
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      &lt;script&gt;
        //Add Stat Form
        //This part here will add the stats, but it won't refresh them!
        $('input#addStatButton').click( function() {
            $.post( '{{action("StatController@store")}}', $('form#new_stat').serialize(), function(data) {
                  $('#statList').load('/take-stats/{{$game-&gt;id}}');
               },
               'json' // I expect a JSON response
            );
            clearStat();
        });
      &lt;/script&gt;
      &lt;script src="{{ URL::asset('js/takeStats/genJavascript.js') }}"&gt;&lt;/script&gt;
      &lt;script src="{{ URL::asset('js/takeStats/videoJS.js') }}"&gt;&lt;/script&gt;
      &lt;script src="{{ URL::asset('js/takeStats/dataJS.js') }}"&gt;&lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Here is the controller method:</p>
  
  <pre><code>public function loadStatList($id) {
      $userType = Auth::user()-&gt;user_type;
      if(Auth::check() &amp;&amp; Game::where('id', '=', $id)-&gt;exists() &amp;&amp; ($userType == 'statistician' || $userType == 'admin')) {
          $game = Game::find($id);
          $players = $game-&gt;team-&gt;users-&gt;where('user_type', 'player');
          $stats = Stat::orderBy('video_timestamp', 'desc')-&gt;where('game_id', $game-&gt;id)-&gt;get();
          $statMeta = Stat_Meta::all()-&gt;where('type', 'recorded');
          return view('partials.statList', compact('game', 'players', 'stats', 'statMeta'));
      } else {
          abort(404);
      }
  }
  </code></pre>
  
  <p>I might be missing something but I thought this would do what I am trying to achieve.</p>