Repeater with relationship also attempts to save to a column

Hi, I have a repeater in a SurveyStep resource which is correctly saving items to a relationship 'questions', however after saving the form I also get Column not found: 1054 Unknown column 'questions' in 'field list' because it is attempting to update survey_steps set questions = ... Any ideas why it is doing both?
4 Replies
toeknee
toeknee2y ago
We would need to see your code
alexanderkroneis
Share some code please
lorlab
lorlabOP2y ago
This is in the SurveyStepResource
Repeater::make('questions')
->relationship()
->hiddenOn(['create'])
->schema([...])
->orderColumn('order')
Repeater::make('questions')
->relationship()
->hiddenOn(['create'])
->schema([...])
->orderColumn('order')
and in my SurveyStep model I have the questions relationship
public function questions(): HasMany
{
return $this->hasMany(SurveyQuestion::class)->orderBy('order');
}
public function questions(): HasMany
{
return $this->hasMany(SurveyQuestion::class)->orderBy('order');
}
the strange this is that i see the udates in the survey_questions table, but then filament also thinks questions is a field on the survey_steps table
toeknee
toeknee2y ago
That is strange

Did you find this page helpful?