F
Filament10mo ago
Patrick

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
Patrick
PatrickOP10mo ago
Filament
FullCalendar by Saade - Filament
The most popular JavaScript calendar as a Filament widget.
LeandroFerreira
LeandroFerreira10mo ago
please ask on #saade-fullcalendar
Patrick
PatrickOP10mo ago
oh didnt see that one thank you
Want results from more Discord servers?
Add your server