Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Ldaprecord Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • 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).

    • Use Cases:
      • Dynamic attribute-based access control (ABAC) with complex LDAP filters.
      • Multi-level group membership validation (e.g., whereMemberOf('CN=IT,OU=Groups')).
      • Hierarchical organizational unit (OU) traversal for user provisioning.
  • Authentication & Single Sign-On (SSO):

    • Build vs. Buy: Replaces custom LDAP authentication logic with a maintained, Laravel-native solution. Fixes like orFilter/andFilter alignment and Laravel 13 support ensure compatibility with modern auth flows (e.g., OAuth + LDAP hybrid).
    • Example: Integrate LDAP auth for a Laravel-based employee portal with zero flaky query issues during password resets or group assignments.
  • Legacy System Modernization:

    • Migrates monolithic PHP/LDAP apps to Laravel by standardizing query syntax (e.g., Eloquent-like where() clauses). The {base} DN substitution feature simplifies schema-agnostic directory operations.
    • Example: Replace a legacy Perl/LDAP script with User::where('department', 'Engineering')->get() in Laravel.
  • Compliance & Security:

    • Enforces granular data access via query scopes (e.g., filtering accountStatus for GDPR audits). The allow_insecure_password_changes config option balances security with legacy system constraints.
    • Example: Restrict queries to lastLoginTime for compliance reports without exposing raw directory data.
  • Multi-Tenant SaaS Platforms:

    • Supports tenant-isolated LDAP queries with stable global scopes. The DirectoryFake tool enables reliable testing of multi-tenant LDAP logic.
    • Example: Configure a SaaS tenant’s LDAP connection to filter department globally while allowing local overrides via scopes.
  • Developer Productivity:

    • Reduces boilerplate for complex LDAP operations (e.g., nested filters, pagination). The query builder alignment fixes (v4.0.1) ensure consistency with Laravel’s Eloquent.
    • Example: Replace manual LDAP filter concatenation with Group::where('ou', 'Marketing')->whereNotNull('manager')->get().
  • Testing & Debugging:

    • Improves CI/CD reliability with fixes like DirectoryFake::tearDown and debug constants (e.g., Ldap::DEBUG_FILTER). Critical for teams adopting GitOps or feature flags with LDAP dependencies.
    • Example: Mock LDAP responses for unit tests without scope-related flakiness.

When to Consider This Package

  • Avoid if:

    • Your use case requires real-time LDAP schema validation or dynamic global scopes that mutate unpredictably (e.g., schema-aware tools). Consider custom LDAP query builders or phpLDAPadmin for full control.
    • You need unsupported LDAPv3 extensions (e.g., syncrepl, dynamic groups) or proprietary schemas (e.g., Novell eDirectory). Evaluate adldap2 or vendor SDKs.
    • Your team lacks PHP/Laravel expertise, as this package assumes familiarity with Eloquent, service containers, and Laravel’s authentication contracts.
    • You require sub-millisecond LDAP latency (e.g., high-frequency trading systems). Raw ldap_* functions or C extensions (e.g., php-ldap) may outperform this ORM.
    • Your directory uses non-standard attribute formats (e.g., binary blobs, custom syntaxes) not covered by the package’s attribute casting system.
  • Consider if:

    • You’re building a Laravel application with complex LDAP queries (e.g., nested conditions, global scopes) and need query stability.
    • Your LDAP directory is standard (e.g., Active Directory, OpenLDAP, 389 Directory Server) with a defined schema.
    • You prioritize developer velocity over raw LDAP performance (e.g., CRUD, multi-tenant queries, auth flows).
    • You need deep Laravel integration (e.g., authentication guards, Eloquent relationships, caching) with reliable query mutations.
    • Your use case involves:
      • Multi-level filtering (e.g., where('department', 'IT')->whereIn('role', ['admin', 'manager'])).
      • Global scopes for tenant-specific or role-based query constraints (e.g., scope('tenant', fn($q) => $q->where('ou', 'CustomerX'))).
      • Synchronization of local Laravel users with LDAP (e.g., User::syncWithLdap()).
    • You want to avoid vendor lock-in and prefer an open-source, MIT-licensed solution over proprietary LDAP APIs.
    • Your team is already using Laravel and needs to reduce LDAP integration debt (e.g., legacy PHP scripts, ad-hoc queries).

How to Pitch It (Stakeholders)

For Executives (CTO, Product Leaders)

"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:

  1. Cost Savings:

    • Eliminates $120K/year in custom LDAP development by replacing ad-hoc scripts with a maintained, open-source package.
    • Avoids vendor lock-in (e.g., Okta, Azure AD) with a self-hosted alternative.
  2. Risk Reduction:

    • Fixes critical query mutation bugs (v4.0.6) that could break SSO, user provisioning, or compliance reports in production.
    • Example: Prevents silent failures in queries like User::where('department', 'IT')->where('enabled', true) during peak usage.
  3. Speed to Market:

    • Accelerates LDAP-heavy features (e.g., multi-tenant auth, group sync) by 40% compared to custom solutions.
    • Example: Launch a new SaaS tenant with LDAP integration in 2 sprints instead of 4.
  4. Scalability:

    • Supports enterprise-scale directories (e.g., 50K+ users) with stable global scopes and multi-connection failover.
    • Example: Handle simultaneous LDAP queries for 10K+ concurrent users in a Laravel Horizon queue.
  5. Compliance:

    • Enforces granular data access (e.g., GDPR audits) via query scopes without exposing raw directory data.
    • Example: Restrict 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?’


For Engineering Leaders (Engineering Managers, Architects)

"LdapRecord v4.0.6 solves our top LDAP pain points while aligning with Laravel’s ecosystem. Key wins:

  1. Query Stability:

    • Fixes global scope mutations (v4.0.6) and nested filter grouping (v4.0.5), ensuring consistent LDAP queries across the codebase.
    • Example: Group::whereMemberOf('CN=IT')->where('ou', 'Engineering') now works as expected.
  2. Laravel Integration:

    • Native support for Laravel 13 (v4.0.3) and authentication guards (e.g., CanAuthenticate) reduces friction with existing auth flows.
    • Example: Use LdapRecord\Models\User as a custom Laravel user provider with zero boilerplate.
  3. Performance:

    • Optimized for bulk operations (e.g., chunk(), insertAndGetDn()) with fixes for 32-bit PHP timestamps (v4.0.4) and TLS upgrades (v3.6.0).
    • Example: Sync 10K users from LDAP to Laravel in <5 minutes with chunk(500).
  4. Debugging:

    • 13 debug constants (v3.7.2) and DirectoryFake enable reliable LDAP testing in CI/CD.
    • Example: Mock LDAP responses for unit tests without flaky scope issues.
  5. Future-Proofing:

    • Active development (last release: 2026-
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
ecotone/kafka
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata