DirectoryTree / LdapRecord-Laravel

Multi-domain LDAP Authentication & Management for Laravel.
https://ldaprecord.com/docs/laravel/v3
MIT License
512 stars 54 forks source link

Emulate memberof #565

Closed cheesegrits closed 1 year ago

cheesegrits commented 1 year ago

Hey Steve,

This isn't a PR for merging, it's just to show you how I went about emulating 'memberof'.

It's mostly done inside applyBatchModificationToModel(), which means it just naturally picks up any changes to the 'member' attribute made in the EmulatesModelQueries trait.

Cases where applyBatchModificationToModel() doesn't get called, like insert(), delete() and updateAttributes() in EmulatesQueries, I do the emulation in those methods.

stevebauman commented 1 year ago

This PR really helped with #584, thanks @cheesegrits! 🙏