topclaudy / compoships

Multi-columns relationships for Laravel's Eloquent ORM
MIT License
1.1k stars 130 forks source link

Relationship on string values #136

Open potasium opened 2 years ago

potasium commented 2 years ago

Columns are varchar and foreign key - local key can be upper case- lower case. In this situation; When using $model1->has('model2') it is working but eager loading returns null.

MaartenOste commented 9 months ago

Same issue here. When I use a varchar identifier in both tables (for example: "ABC-12345") eager loading doens't work. When I remove the relationship from eager loading, accessing the model through the relationship does work doh. I tried changing the identiefier to an integer and this made eager loading possible again.