filament repeat issue inside widget
I have a filament repeater inside a widget with relationship method it i get error: Call to a member function reminders() on null. This repeater works just fine in a filament resource. This is the repeater:
Repeater::make('reminders')
->label(('labels.reminders'))
->relationship('reminders')
->default()
->schema([
TextInput::make('quantity')
->label(('labels.reminder_quantity'))
->numeric()
->minValue(1)
->required(),
Select::make('unit')
->label(('labels.reminder_unit'))
->options([
'minutes' => ('labels.minutes'),
'hours' => ('labels.hours'),
'days' => ('labels.days'),
'weeks' => ('labels.weeks'),
])
->required(),
// Default
name
and description
from the main event
TextInput::make('name')
->label(('labels.reminder_name'))
->required(),
Textarea::make('description')
->label(('labels.reminder_description')),
Checkbox::make('notify_via_email')
->label(('labels.notify_via_email'))
]),Solution:Jump to solution
customize the headerAction
```php
protected function headerActions(): array
{...
18 Replies
are you using a custom livewire component?
Νο this is inside the app/filament/widgets/calendarwidget and using the saade plugin
this is the full resource
could you share the form code?
reminders
relationship is null at this moment. If you are using a livewire component, I think you should do this when you are using relationships, but honestly I didn't understand your code and where are you rendering the form.
Maybe you could provide a minimal repo on Github to reproduce this issueI don't use livewire. A Made a minimal repo and i reproduce the issue https://github.com/giapele/test-app
GitHub
GitHub - giapele/test-app
Contribute to giapele/test-app development by creating an account on GitHub.
the events from the resource work fine but with the same code on the calendarwidget i can view the created events but i can't create i get the previous error
Solution
customize the headerAction
thank you the create work, but now on view it shows empty
what view?
when i click the event on the calendar it opens the event but it looking for the getFormSchema i previously using
I think you can customize all actions, View, Edit..
yes but this way i will have the form dublicate and if I add a field i don't want to have to add it 2 times
ask on #saade-fullcalendar
maybe someone can help you
ok thank you
i did this and it works