saade / filament-fullcalendar

The Most Popular JavaScript Calendar as a Filament Widget
MIT License
269 stars 83 forks source link

Model labels not working #128

Open Milorn opened 10 months ago

Milorn commented 10 months ago

image Using the label fields $modelLabel and $pluralModelLabel is not working, the title of the modal is being made of the class name, after doing some research it looks like there is a conflict with the InteractsWithRecords trait

danielschweiger commented 9 months ago

This is my solution right now:

class CalendarWidget extends FullCalendarWidget

protected function headerActions(): array
{
    return [
        CreateAction::make()
            ->modalHeading('Custom Heading')
            ->mountUsing(
                function (Form $form, array $arguments) {
                    $form->fill([
                        'start' => $arguments['start'] ?? null,
                        'end' => $arguments['end'] ?? null
                    ]);
                }
            )
    ];
}

protected function modalActions(): array
{
    return [
        Actions\EditAction::make()
            ->modalHeading('Custom Heading for Edit'),
        Actions\DeleteAction::make()
            ->modalHeading('Custom Heading for Delete'),
    ];
}