addEagerConstraints method
Set the constraints for an eager load of the relation.
Implementation
@override
void addEagerConstraints(List<KhademModel> models) {
_performJoin();
final keys = models
.map((model) => model.getAttribute(localKey))
.where((key) => key != null)
.toSet()
.toList();
query.whereIn('$throughTable.$firstKey', keys);
query.select(['${query.table}.*']);
query.selectRaw('$throughTable.$firstKey as khadem_through_key');
}