F
Filament15mo ago
lorlab

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
toeknee15mo ago
We would need to see your code
alexanderkroneis
alexanderkroneis15mo ago
Share some code please
lorlab
lorlabOP15mo 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
toeknee15mo ago
That is strange
Want results from more Discord servers?
Add your server