belongsTo(Lecturer::class); } public static function getOptionsForLecturer(Lecturer $lecturer): Collection { return static::query() ->where('lecturer_id', $lecturer->id) ->get(); } public function materials(): HasMany { return $this->hasMany(Material::class); } public function studyGroups(): BelongsToMany { return $this->belongsToMany(StudyGroup::class, 'study_group_courses'); } }