Weave 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 full-featured LDAP ORM for PHP and Laravel. It offers ActiveRecord-style models, a fluent query builder, authentication, and multi-domain connection management, making OpenLDAP and Active Directory integration simple and expressive.

View on GitHub
Deep Wiki
Context7

A fully-featured LDAP ORM.

Frequently asked questions about Ldaprecord
What is LdapRecord and how does it work with Laravel?
LdapRecord is a fully featured LDAP ORM with an ActiveRecord-style API for querying and managing directory entries. The core package, directorytree/ldaprecord, is framework-agnostic; Laravel integration such as auth guards and configuration lives in the companion ldaprecord-laravel package. It gives Laravel developers familiar models, fluent queries, casts, scopes, and relationships for Active Directory or OpenLDAP data. Treat LDAP as a secondary read/write data source behind a service layer rather than a replacement for your SQL database.
How do I install and configure LdapRecord in a Laravel app?
For Laravel, install the ldaprecord-laravel wrapper via Composer; it brings in the core directorytree/ldaprecord package. Publish the configuration, define a connection for your directory, choose the Active Directory, OpenLDAP, or FreeIPA provider, and add models plus an auth guard as needed. Multi-connection support lets you target staging and production domain controllers without branching code. You will also need the PHP ldap extension and network access to LDAPS or StartTLS.
Which Laravel versions does LdapRecord support?
The assessment notes two live major branches, v3 and v4, both receiving Laravel 13 support, but Laravel compatibility ultimately depends on the companion ldaprecord-laravel wrapper. Pin one major branch and verify the wrapper's release cadence and version alignment before treating Laravel 13 support as delivered end to end. Avoid straddling v3 and v4 in one codebase because model behavior can differ.
Can I use LdapRecord without Laravel?
Yes. The core directorytree/ldaprecord package is a framework-agnostic ActiveRecord-style LDAP ORM, while the Laravel-specific surface lives in ldaprecord-laravel. You can use the core in plain PHP applications, but you will wire configuration and integration concerns yourself. If you need Laravel auth guards, facades, or package config publishing, use the wrapper.
Does LdapRecord work with Active Directory and OpenLDAP?
LdapRecord supports Active Directory and OpenLDAP, with provider selection for AD, OpenLDAP, and FreeIPA. The main risk is schema and directory variance: AD and OpenLDAP differ on timestamps, boolean encoding, password modify semantics, and group nesting. Budget for schema discovery per target directory and test against a realistic staging domain controller before relying on casts or relationship behavior in production.
How do I test LdapRecord code without a real LDAP server?
Use DirectoryFake plus events and logging hooks to test authentication and provisioning flows in CI without a live domain controller. The Ldap::DEBUG_* constants can help with diagnostics during development. This lets you specify and regression-test directory flows before touching production LDAP infrastructure. Still test against a real directory before release because schema variance can expose issues fakes do not cover.
Can LdapRecord authenticate users and handle password changes?
Yes. The Laravel wrapper provides auth guard integration for authenticating users against Active Directory or OpenLDAP directories. User::changePassword() arrived in v4.1.0 and enables self-service password flows, but the allow_insecure_password_changes option should be treated as forbidden in production. Confirm password-modify semantics for your directory type and ensure password redaction in exception traces is enabled for audit posture.
Is LdapRecord safe for production write operations?
Phase write operations behind a feature flag and do not enable bulk mutation before security review. Recent v4.1.1 fixes addressed group deletion on relationship detach and silent attribute loss on replacement, so adjacent write paths deserve explicit tests. Keep password-change surfaces tightly controlled and forbid insecure password-change configuration. Also verify that exception traces redact credentials as part of your logging and audit controls.
How does LdapRecord handle large directories and pagination?
Multiple v4.1.1 fixes target pagination, early-termination cleanup, and paging state, so do not assume defaults are safe for directory-wide reporting or bulk sync. Test large-directory behavior explicitly, including chunking and query termination, against a realistic directory. Caching may be viable but should be treated as untrusted until re-verified because query-cache keying and relationship matching have had subtle fixes.
What are alternatives to LdapRecord or writing custom LDAP code?
If you want an Eloquent-style model and query API inside Laravel, LdapRecord removes a lot of bespoke ldap_* wrapper code and lets existing Laravel engineers work with directory data using familiar patterns. For narrow one-off bind or search tasks, the native PHP LDAP extension may be enough, while heavier custom wrappers trade convenience for control. Evaluate based on whether you need models, relationships, casts, auth integration, and test fakes rather than just raw LDAP calls. Keep LDAP behind a service layer rather than replacing SQL.
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.
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator