title: FullCalendar get events from database
body: <p>Hi i am using FullCalendar in a laravel project and i need to display the events from the database.</p>
  
  <p>I get all the events from the database and display them using json_encode.</p>
  
  <p>There is the code i use :</p>
  
  <p>My controller :</p>
  
  <pre class="lang-php prettyprint-override"><code>
  &lt;?php
  
  namespace App\Http\Controllers;
  use App\Http\Gestionnaires\EventGestionnaire;
  use Illuminate\Http\Request;
  
  class EventController extends Controller
  {
      public function afficher(){
  
          $eventGestionnaire = new EventGestionnaire;
          $listeEvents = $eventGestionnaire-&gt;getListeEvents();
  
          echo json_encode($listeEvents);
  
  
          return view('pages.calendar');
  
      }
  }
  
  </code></pre>
  
  <p>And my script :</p>
  
  <pre><code>
  $calendar.fullCalendar({
  
      viewRender: function(view, element) {
          if (view.name != 'month'){
  
              $(element).find('.fc-scroller').perfectScrollbar();
  
          }
      },
  
      resourceEditable: true,
      eventLimit: true,
      editable: true,
      selectable: true,
      selectHelper: true,
      header: {
          left: 'month,agendaWeek,agendaDay',
          center: 'title',
          right: 'prev,next,today'
      },
  
      events: 'EventController.php',
  
  </code></pre>
  
  <p>The error : </p>
  
  <p>jquery.min.js:3049 GET <a href="http://localhost/planner/public/EventController.php?start=2019-09-01&amp;end=2019-10-13&amp;_=1568831263931" rel="nofollow noreferrer">http://localhost/planner/public/EventController.php?start=2019-09-01&amp;end=2019-10-13&amp;_=1568831263931</a> 404 (Not Found)</p>