Relationship repeater not working

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

This model has many
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);
}


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')


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


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

and in the save method i call save relationships:
$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
Was this page helpful?