© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
8 replies
ZeroCharistmas

Repeater not saving pivot relationship

I've been searching the docs, the filament repo, and discord all day and have found people with similar issues, but none of the fixes are working. For some reason the repeater data just will not save.

The repeater is defined as:
Repeater::make('userEvents')
    ->relationship()
    ->model(CalendarEvent::class)
    ->schema([
        Select::make('user_id')
            ->relationship('user','name'),
        Select::make('user_role')
            ->enum(EventUserRole::class)
            ->options(EventUserRole::class),
        DateTimePicker::make('remind_at')
            ->seconds(false),
])
Repeater::make('userEvents')
    ->relationship()
    ->model(CalendarEvent::class)
    ->schema([
        Select::make('user_id')
            ->relationship('user','name'),
        Select::make('user_role')
            ->enum(EventUserRole::class)
            ->options(EventUserRole::class),
        DateTimePicker::make('remind_at')
            ->seconds(false),
])


using the pivot model UserEvent:
    public function user(): BelongsTo
    {
        return $this->belongsTo(User::class);
    }
    public function calendarEvent(): BelongsTo
    {
        return $this->belongsTo(CalendarEvent::class);
    }
    public function user(): BelongsTo
    {
        return $this->belongsTo(User::class);
    }
    public function calendarEvent(): BelongsTo
    {
        return $this->belongsTo(CalendarEvent::class);
    }


One thing I've noticed is that in the edit page, Repeater.php:1095 will run this query:
SELECT * FROM `user_events` WHERE `user_events`.`calendar_event_id` IS NULL and `user_events`.`calendar_event_id` IS not NULL
SELECT * FROM `user_events` WHERE `user_events`.`calendar_event_id` IS NULL and `user_events`.`calendar_event_id` IS not NULL
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Repeater pivot
FilamentFFilament / ❓┊help
3y ago
Saving repeater with relationship as json
FilamentFFilament / ❓┊help
3y ago
Pivot not saving to db?
FilamentFFilament / ❓┊help
3y ago
Multiple Text Inputs From Relationship / Saving To Pivot
FilamentFFilament / ❓┊help
2y ago