Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Model labels not working #128

Open
Milorn opened this issue Nov 15, 2023 · 1 comment
Open

Model labels not working #128

Milorn opened this issue Nov 15, 2023 · 1 comment

Comments

@Milorn
Copy link

Milorn commented Nov 15, 2023

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
Copy link

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'),
    ];
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants