topclaudy / compoships

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

Perf: Use parent implemention for non-composite keys #73

Closed mpyw closed 4 years ago

mpyw commented 4 years ago

Fixes #72.

From version 5.7 Laravel introduced eager loading optimization when $keyType is "int" or "integer". Composite relation should also follow the optimization, however, it's a quite difficult to implement as well. So I improved that the original optimization can be applied when keys are not composite at least.