Closed jvbalcita closed 3 years ago
Please share the structure of all three tables.
Hi @staudenmeir ,
Course id
Admission Request course_id
Payment Type course_id
Admission Request > BelongsTo
> Course > HasOne
> PaymentTypes
You can actually do this with a native HasOneThrough
relationship:
public function paymentTypes()
{
return $this->hasOneThrough(
PaymentType::class,
Course::class,
'id',
'course_id',
'course_id',
'id'
);
}
This worked thank you @staudenmeir
Hi just wanted to ask if there's a way to connect belongsTo > HasOne relationship using the BelongsToThrought Trait.
I have a Admission Request > BelongsTo > Course > HasOne > PaymentTypes
Thank you for your answer! :)