title: Fullcalendar 3 change draggable events when changing week
body: <p>I work with fullcalendar 3 with laravel.</p>
  
  <p>The draggable events are courses and should be different every week. I want to dynamically change the courses when I change the week in the calendar.</p>
  
  <p>At the moment in the controller I have a function that give me every course:</p>
  
  <pre><code>public function index()
      {
          $corsi = Corso::select('titolo', 'descrizione','ore_45esimi')-&gt;get();
          return view('lezione.calendario_lezioni')-&gt;with(array('corsi' =&gt; $corsi));
      }
  </code></pre>
  
  <p>then in the view I display the events using a div:</p>
  
  <pre><code>&lt;div id="external-events"&gt;
    @foreach($corsi as $corso)
      &lt;div class="external-event bg-formazione"&gt;{{$corso-&gt;titolo }}
        &lt;br&gt;
        &lt;div style="font-size: small"&gt;{{$corso-&gt;descrizione }} &lt;/div&gt;
        &lt;input id="ore" type="hidden" value="{{$corso-&gt;ore_45esimi }}"&gt;
      &lt;/div&gt;
     @endforeach
   &lt;/div&gt;
  </code></pre>
  
  <p>And in the Fullcalendar js file I have a function to make the courses draggable:</p>
  
  <pre><code>    function ini_events(ele) {
              ele.each(function () {
                  let eventObject = {
                      title: $(this).contents()
                          .filter(function () {
                              return !!$.trim(this.innerHTML || this.data);
                          })
                          .first().text(),
  
                      descrizione: $.trim($(this).contents()[3].firstChild.textContent),
                      ore: $(this).contents('#ore').val(),
                      color: $(this).css("background-color"), 
                  };
                  $(this).data('event', eventObject);
  
                  $(this).draggable({
                      zIndex: 1070,
                      revert: true, 
                      revertDuration: 0  
                  });
  
              });
          }
  
  ini_events($('#external-events div.external-event'));
  </code></pre>
  
  <p>I found the viewRender function that allow me to get the begin and the end of the displayed week:</p>
  
  <pre><code>$('#calendar').fullCalendar({
  ...
  
  viewRender: function (element) {
              var start = moment(element.intervalStart).format();
              var end = moment(element.intervalEnd).subtract(1, 'd').format();
  
          },
  });
  </code></pre>
  
  <p>How can I use the start and end variable into the index method in the controller's query when I first show the calendar and every time I change the week?</p>