© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
26 replies
Eric

Relationship repeater not working

I'm creating a form where the users create a new
PlayerPreinscription
PlayerPreinscription
model.

This model has many
PlayerTutorPreinscription
PlayerTutorPreinscription
:
// app/Models/Tenant/PlayerPreinscription.php
protected $table = 'player_preinscriptions';

public function tutors(): HasMany
{
    return $this->hasMany(PlayerTutorPreinscription::class);
}

// app/Models/Tenant/PlayerTutorPreinscription.php
protected $table = 'player_tutor_preinscriptions';

public function playerPreinscription(): BelongsTo
{
    return $this->belongsTo(PlayerPreinscription::class);
}
// app/Models/Tenant/PlayerPreinscription.php
protected $table = 'player_preinscriptions';

public function tutors(): HasMany
{
    return $this->hasMany(PlayerTutorPreinscription::class);
}

// app/Models/Tenant/PlayerTutorPreinscription.php
protected $table = 'player_tutor_preinscriptions';

public function playerPreinscription(): BelongsTo
{
    return $this->belongsTo(PlayerPreinscription::class);
}


So a person can fill the form with multiple tutors (repeater) for a player.

if in the form i put this line, i get the error (see image), otherwise i dont get the error but the items in the repeater are ignored and not saved into the db.
->relationship('tutors')
->relationship('tutors')


other stuff i already do:
in mount method:
$this->playerPreinscription = new PlayerPreinscription;
$this->playerPreinscription = new PlayerPreinscription;


i also defined the fn:
protected function getFormModel(): PlayerPreinscription
{
    return $this->playerPreinscription;
}
protected function getFormModel(): PlayerPreinscription
{
    return $this->playerPreinscription;
}

and in the save method i call save relationships:
$this->form->model($this->playerPreinscription)->saveRelationships();
$this->form->model($this->playerPreinscription)->saveRelationships();


i am missing something? what is happening? ive been strugling for quite a time now... hours
Screenshot_2024-06-11_at_11.51.27.png
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 relationship translation not working
FilamentFFilament / ❓┊help
3y ago
Repeater relationship translation not working
FilamentFFilament / ❓┊help
3y ago
Repeater reordering not working on relationship
FilamentFFilament / ❓┊help
3y ago
Repeater not saving pivot relationship
FilamentFFilament / ❓┊help
2y ago