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

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • 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

    • Phase 1: Replace ad-hoc LDAP queries in auth systems (e.g., ldap_search() calls) with LdapRecord’s query builder for consistency and maintainability.
    • Phase 2: Extend to directory synchronization (e.g., mirroring LDAP groups to a local database for offline access).
    • Phase 3: Integrate with Laravel Nova/Panel for LDAP user management UIs.
  • Use Cases

    • Authentication: Replace adldap2 or custom LDAP bindings with a Laravel-native solution (e.g., User::where('mail', $email)->first()).
    • Provisioning: Bulk-create/update users/groups via Model::create() or Builder::insert().
    • Compliance: Audit LDAP operations with debug logs (Ldap::DEBUG_ANY) for security reviews.
    • Multi-Tenant LDAP: Use DistinguishedName methods (e.g., isSiblingOf()) to manage tenant-specific directory branches.

When to Consider This Package

Adopt LdapRecord If:

  • Your Laravel app relies on LDAP/Active Directory for authentication, user management, or directory services.
  • You need Laravel-like syntax for LDAP operations (e.g., User::where('department', 'Engineering')->get() instead of raw LDAP filters).
  • You require support for modern Laravel versions (11–13) and PHP 8.1+.
  • Your team lacks deep LDAP expertise but needs robust error handling (e.g., TLS upgrades, connection retries).
  • You need Active Directory-specific features like memberOf queries or GUID/SID handling.

Look Elsewhere If:

  • You’re using non-Laravel frameworks (e.g., Symfony, Django). While the core library is framework-agnostic, Laravel-specific features (e.g., Eloquent integration) won’t apply.
  • Your LDAP directory is highly custom (e.g., non-standard schemas, proprietary extensions). The package assumes standard LDAP/AD attributes (e.g., cn, mail, memberOf).
  • You need real-time LDAP sync (e.g., sub-second updates). LdapRecord is optimized for query performance but not push-based synchronization (consider tools like Syncthing or 389 Directory Server for this).
  • Your budget allows for commercial LDAP tools (e.g., One Identity, ForgeRock) with dedicated support.

How to Pitch It (Stakeholders)

For Executives:

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

  • Time Saved: Replace 100+ lines of raw LDAP code with 10 lines of Eloquent-like queries.
  • Risk Reduction: Handles edge cases (e.g., TLS failures, UTF-8 strings) that custom code often misses.
  • Scalability: Supports Laravel 11–13 and PHP 8.4, ensuring long-term compatibility.

For Engineering Teams:

*"LdapRecord gives us a Laravel-native LDAP ORM with these key advantages over ad-hoc solutions or adldap2:

  • Query Builder: Chain methods like Eloquent (User::where('enabled', true)->orderBy('lastName')).
  • Active Directory Optimizations: Built-in support for memberOf, GUIDs, and AD-specific quirks (e.g., timestamp rounding).
  • Debugging: Granular debug levels (Ldap::DEBUG_FILTER, DEBUG_TLS) to troubleshoot connection issues.
  • Testing: Fake LDAP directories for unit tests (via DirectoryFake).
  • Performance: Chunking support (chunk(100)) for large directory exports.

Migration Path:

  1. Start with auth flows (replace ldap_bind() calls with LdapRecord\Auth::attempt()).
  2. Replace ldap_search() with User::all() or custom queries.
  3. Use DistinguishedName helpers for complex DN operations (e.g., isSiblingOf()).

Trade-offs:

  • Learning Curve: Requires adopting LDAP-specific concepts (e.g., objectClass, base DN).
  • Limited to LDAP/AD: Not a general-purpose database ORM (use Eloquent for SQL)."*

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:

  • 50% fewer bugs (handles TLS, encoding, and AD quirks out of the box).
  • Faster onboarding (new devs can use Eloquent-like syntax).
  • Future-proofing (supports Laravel 13 and PHP 8.4).

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."*

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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4