Calendar plugin will not show events unless we an array

calendar package works great, but it only works when i use an array as event data, when using the EventData class nothing shows up, except when i call toArray() myself
return CourseInstanceSchedule::with('courseInstance')
->whereBetween('start_date', [$fetchInfo['start'], $fetchInfo['end']])
->get()
->map(function($schedule){
return EventData::make()
->id($schedule->id)
->title($schedule->courseInstance->course->name)
->start(
$this->getDateAndTime($schedule->start_date, $schedule->start_time),
)
->end(
$this->getDateAndTime($schedule->start_date, $schedule->end_time)
)
->backgroundColor('red')
->borderColor('red')
->textColor('white')
->toArray();
})->all();
return CourseInstanceSchedule::with('courseInstance')
->whereBetween('start_date', [$fetchInfo['start'], $fetchInfo['end']])
->get()
->map(function($schedule){
return EventData::make()
->id($schedule->id)
->title($schedule->courseInstance->course->name)
->start(
$this->getDateAndTime($schedule->start_date, $schedule->start_time),
)
->end(
$this->getDateAndTime($schedule->start_date, $schedule->end_time)
)
->backgroundColor('red')
->borderColor('red')
->textColor('white')
->toArray();
})->all();
Without the toArray() the calendar stays empty. Not really a big issue, but it shouldn't be nessecary right?
3 Replies
Patrick1989
Patrick19895mo ago
Filament
FullCalendar by Saade - Filament
The most popular JavaScript calendar as a Filament widget.
LeandroFerreira
LeandroFerreira5mo ago
please ask on #saade-fullcalendar
Patrick1989
Patrick19895mo ago
oh didnt see that one thank you