gearbox-solutions / eloquent-filemaker

A Model extension and Eloquent driver for Laravel connecting to FileMaker through the Data API
https://gearboxgo.com
MIT License
54 stars 16 forks source link

Add eager loading #29

Closed likeadeckofcards closed 2 years ago

likeadeckofcards commented 2 years ago

This PR adds an override to the whereIn method to make it work with FileMaker expected API as well as add the capability to handle eager loading relationships when retrieving models.

Also, because FileMaker does not use null values for empty foreign keys we needed to override a method BelongsTo Relation that gathers the keys for the related models. This method will filter out null and empty strings to prevent a FM Data API Error.

Closes #20.