Controller Function to get values from DB
public function index(Request $request)
{
$getEvents2 = DB::table("appointments_tbl")
->join("patients_tbl", function($join){
$join->on("appointments_tbl.patient_id", "=", "patients_tbl.id");
})
->select("appointments_tbl.start_time","appointments_tbl.end_time", "patients_tbl.status", "patients_tbl.first_name")
->get();
$events = [];
foreach ($getEvents2 as $values) {
$event = [];
$event['title'] = $values->first_name;
$event['status'] = $values->status;
$event['start'] = $values->start_time;
$event['end'] = $values->end_time;
$events[] = $event;
}
return $events;
}
In the FullCalendar Initialization function, added the function to append the status field value.
events: 'getEvents',
eventDidMount: function(event) {
$('.fc-event-time').append("<br/>" + event.status);
},
Here is the answer
events: 'getEvents',
eventDidMount: function(info) {
var statusText = info.event.extendedProps.status;
$(info.el).find('.fc-event-time').append("<br/>" + statusText);
},
Thank you so much for the help!