You cannot use $this->programme_id in the context of eager-loading relations; there is no hydrated Model instance to work with.
Can you share how you are using the relationship outside Filament, so we can understand how it is working?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
please help me with this situation, if I use this relationship outside of filament it works well but inside filament, it is changing the $this->programme_id to null.
public function programmeCourse(): BelongsTo { return $this->belongsTo(ProgrammeCourse::class, 'course_id', 'course_id') ->where('programme_id', $this->programme_id); }
here is the resulting query inside filament
select * from programme_courses where programme_id is null and programme_courses.course_id in (3, 4, 5, 8, 10, 14, 19, 23, 25, 35)
Please or to participate in this conversation.