// app/Models/Tenant/PlayerPreinscription.phpprotected $table = 'player_preinscriptions';public function tutors(): HasMany{ return $this->hasMany(PlayerTutorPreinscription::class);}// app/Models/Tenant/PlayerTutorPreinscription.phpprotected $table = 'player_tutor_preinscriptions';public function playerPreinscription(): BelongsTo{ return $this->belongsTo(PlayerPreinscription::class);}
// app/Models/Tenant/PlayerPreinscription.phpprotected $table = 'player_preinscriptions';public function tutors(): HasMany{ return $this->hasMany(PlayerTutorPreinscription::class);}// app/Models/Tenant/PlayerTutorPreinscription.phpprotected $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;}