directorytree/ldaprecord
LDAPRecord is a fully featured LDAP and Active Directory ORM for Laravel and PHP. It provides Eloquent-style models, querying, authentication and user sync, and tools for working with directory entries, connections, and schema—built for reliable, modern LDAP apps.
LDAP Integration for Authentication & Directory Services Enable seamless LDAP/Active Directory integration for user authentication, role-based access control (RBAC), and directory management in Laravel applications. Replace or augment custom-built LDAP solutions with a battle-tested ORM, reducing technical debt and improving reliability.
Enterprise Identity Management Support hybrid identity workflows (e.g., syncing user profiles between LDAP and a custom database) for HR systems, SaaS platforms, or internal tools requiring directory synchronization.
Build vs. Buy Decision
Buy: Avoid reinventing LDAP query logic, connection pooling, or schema mapping. LdapRecord abstracts LDAP complexity (e.g., handling TLS, base DN substitution, or Active Directory-specific quirks like memberOf queries) with Laravel’s Eloquent-like syntax.
Build: Only if requiring highly specialized LDAP operations (e.g., custom LDAP controls, proprietary directory schemas) not covered by the package.
Roadmap Priorities
ldap_search() calls) with LdapRecord’s query builder for consistency and maintainability.Use Cases
adldap2 or custom LDAP bindings with a Laravel-native solution (e.g., User::where('mail', $email)->first()).Model::create() or Builder::insert().Ldap::DEBUG_ANY) for security reviews.DistinguishedName methods (e.g., isSiblingOf()) to manage tenant-specific directory branches.User::where('department', 'Engineering')->get() instead of raw LDAP filters).memberOf queries or GUID/SID handling.cn, mail, memberOf)."LdapRecord lets us standardize LDAP integrations across our Laravel apps—reducing the risk of custom LDAP code while cutting development time by 40%. It’s like Eloquent for Active Directory, so our engineers can query users/groups with familiar syntax (e.g., User::where('title', 'Manager')->get()). This also future-proofs our auth systems for compliance audits, thanks to built-in debug logging and TLS support. With zero dependents but 578 stars, it’s a stable, community-backed choice that avoids vendor lock-in."
ROI Highlights:
*"LdapRecord gives us a Laravel-native LDAP ORM with these key advantages over ad-hoc solutions or adldap2:
User::where('enabled', true)->orderBy('lastName')).memberOf, GUIDs, and AD-specific quirks (e.g., timestamp rounding).Ldap::DEBUG_FILTER, DEBUG_TLS) to troubleshoot connection issues.DirectoryFake).chunk(100)) for large directory exports.Migration Path:
ldap_bind() calls with LdapRecord\Auth::attempt()).ldap_search() with User::all() or custom queries.DistinguishedName helpers for complex DN operations (e.g., isSiblingOf()).Trade-offs:
objectClass, base DN).Example Pitch for a Tech Lead: *"We’re currently maintaining 3 separate LDAP integrations across our apps. LdapRecord lets us consolidate these into a single, maintainable library with:
Let’s prototype it for the auth service first—if it saves us 2 weeks of dev time, we can expand it to directory sync."*
How can I help you explore Laravel packages today?