directorytree/ldaprecord
LDAPRecord is an LDAP directory and Active Directory ORM for Laravel and PHP. It provides fluent models, query builder, authentication and user sync, event-driven operations, and easy integration with Laravel apps for managing and searching directory entries.
Identity & Access Management (IAM) Systems: Leverages LdapRecord to build a custom IAM solution within Laravel, avoiding proprietary costs (e.g., Okta, Azure AD) while maintaining RBAC/ABAC flexibility. The fix for global scope query mutations ensures reliability for hierarchical directory queries (e.g., nested memberOf filters in Active Directory).
whereMemberOf('CN=IT,OU=Groups')).Authentication & Single Sign-On (SSO):
orFilter/andFilter alignment and Laravel 13 support ensure compatibility with modern auth flows (e.g., OAuth + LDAP hybrid).Legacy System Modernization:
where() clauses). The {base} DN substitution feature simplifies schema-agnostic directory operations.User::where('department', 'Engineering')->get() in Laravel.Compliance & Security:
accountStatus for GDPR audits). The allow_insecure_password_changes config option balances security with legacy system constraints.lastLoginTime for compliance reports without exposing raw directory data.Multi-Tenant SaaS Platforms:
DirectoryFake tool enables reliable testing of multi-tenant LDAP logic.department globally while allowing local overrides via scopes.Developer Productivity:
Group::where('ou', 'Marketing')->whereNotNull('manager')->get().Testing & Debugging:
DirectoryFake::tearDown and debug constants (e.g., Ldap::DEBUG_FILTER). Critical for teams adopting GitOps or feature flags with LDAP dependencies.Avoid if:
syncrepl, dynamic groups) or proprietary schemas (e.g., Novell eDirectory). Evaluate adldap2 or vendor SDKs.ldap_* functions or C extensions (e.g., php-ldap) may outperform this ORM.Consider if:
where('department', 'IT')->whereIn('role', ['admin', 'manager'])).scope('tenant', fn($q) => $q->where('ou', 'CustomerX'))).User::syncWithLdap())."LdapRecord is the missing link for scaling our LDAP-dependent products—it turns a high-maintenance, error-prone integration into a reliable, Laravel-native solution. Here’s the business case:
Cost Savings:
Risk Reduction:
User::where('department', 'IT')->where('enabled', true) during peak usage.Speed to Market:
Scalability:
Compliance:
lastLoginTime queries to compliance teams only using scopes.Ask: ‘Should we allocate 1 sprint to integrate LdapRecord and eliminate LDAP tech debt, or continue burning dev cycles on custom fixes?’
"LdapRecord v4.0.6 solves our top LDAP pain points while aligning with Laravel’s ecosystem. Key wins:
Query Stability:
Group::whereMemberOf('CN=IT')->where('ou', 'Engineering') now works as expected.Laravel Integration:
CanAuthenticate) reduces friction with existing auth flows.LdapRecord\Models\User as a custom Laravel user provider with zero boilerplate.Performance:
chunk(), insertAndGetDn()) with fixes for 32-bit PHP timestamps (v4.0.4) and TLS upgrades (v3.6.0).chunk(500).Debugging:
DirectoryFake enable reliable LDAP testing in CI/CD.Future-Proofing:
How can I help you explore Laravel packages today?