To view a working example of a FullCalendar implementation that I set up head over to https://fvrs.org/events
Here is the JS behind the calendar:
$(document).ready(function() {
$("#calendar").fullCalendar({
editable: false,
events: '/events/events-json'
});
});
When the calendar loads or when you change the month, fullCalendar will append GET variables including start and end (YYYY-mm-dd format). You can use these parameters to select events from your database.
This implementation does not have very many events so I just return them all without using any sort of query (bad practice, I will be revising soon). Here is my controller for this route:
public function getEventsJson() {
$events = CalendarEvent::wherePublic(1)->get();
$eventsJson = array();
foreach ($events as $event) {
$eventsJson[] = array(
'id' => $event->id,
'title' => $event->title,
'url' => URL::to('events/event/' . date("Y/m/d/", strtotime($event->start_date)) . $event->slug),
'start' => $event->start_date
);
}
return Response::json($eventsJson);
}
Hope this helps..