Call to a member function associate() on null

Student
public function englishExams(): BelongsToMany
{
return $this->belongsToMany(EnglishExam::class, 'english_exam_student');
}
public function englishExams(): BelongsToMany
{
return $this->belongsToMany(EnglishExam::class, 'english_exam_student');
}
EnglishExam
public function students(): BelongsToMany
{
return $this->belongsToMany(Student::class, 'english_exam_student');
}
public function students(): BelongsToMany
{
return $this->belongsToMany(Student::class, 'english_exam_student');
}
StudentResource
Repeater::make('englishExams')
->relationship()
->schema([
Select::make('english_exam_id')
->label('English Exam')
->options(EnglishExam::all()->pluck('title', 'id'))
->required(),
TextInput::make('speaking_score')
->label('Speaking Score')
->numeric()
->required(),
TextInput::make('reading_score')
->label('Reading Score')
->numeric()
->required(),
TextInput::make('writing_score')
->label('Writing Score')
->numeric()
->required(),
])
->columns(4)
->label('English Exams'),
Repeater::make('englishExams')
->relationship()
->schema([
Select::make('english_exam_id')
->label('English Exam')
->options(EnglishExam::all()->pluck('title', 'id'))
->required(),
TextInput::make('speaking_score')
->label('Speaking Score')
->numeric()
->required(),
TextInput::make('reading_score')
->label('Reading Score')
->numeric()
->required(),
TextInput::make('writing_score')
->label('Writing Score')
->numeric()
->required(),
])
->columns(4)
->label('English Exams'),
I get "Call to a member function associate() on null"
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server