Call to a member function associate() on null
Student
EnglishExam
StudentResource
I get "Call to a member function associate() on null"
public function englishExams(): BelongsToMany
{
return $this->belongsToMany(EnglishExam::class, 'english_exam_student');
}
public function englishExams(): BelongsToMany
{
return $this->belongsToMany(EnglishExam::class, 'english_exam_student');
}
public function students(): BelongsToMany
{
return $this->belongsToMany(Student::class, 'english_exam_student');
}
public function students(): BelongsToMany
{
return $this->belongsToMany(Student::class, 'english_exam_student');
}
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'),
0 Replies