Download the PHP package ismailelbery/laravel-ldap-sync without Composer

On this page you can find all versions of the php package ismailelbery/laravel-ldap-sync. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-ldap-sync

Laravel LDAP Sync

Latest Version on Packagist Tests Total Downloads

An opinionated LDAP / Active Directory user synchronization package for Laravel. Sync users from multiple Organizational Units (OUs) into your local database on a schedule, with department mapping, attribute transformation, and full sync reporting β€” built on top of LdapRecord.

Designed for enterprise and government environments where Active Directory is the source of truth and your Laravel application needs a reliable, queryable local copy of users.


✨ Features


πŸ“¦ Installation

Publish the config and migrations:


βš™οΈ Configuration

All connection settings live in your .env:

The published config/ldap-sync.php lets you define attribute mapping:


πŸš€ Usage

Run a sync manually

Sync a specific OU only

Preview changes without writing (dry run)

Example output:

Schedule it

In routes/console.php (Laravel 11):

Listen to events


πŸ” User Search

Search Active Directory directly (live, not the local table) using the LdapUserSearch facade. All searches run across all configured OUs and merge + deduplicate results by objectguid.

Each result is returned as an LdapUserDto with a consistent shape regardless of AD schema quirks:

Search command

A quick CLI lookup is also included:


πŸ‘” Manager Resolution

Resolve reporting lines straight from the AD manager attribute.

This is particularly useful for approval workflows β€” route a request to a user's direct manager, or escalate up the chain automatically:

Note: Manager resolution requires the manager attribute to be populated in your AD. The chain resolver guards against circular references and missing managers, returning the chain built so far rather than throwing.


🧱 How It Works

  1. Connects to your LDAP/AD server using LdapRecord with the credentials in config/ldap.php.
  2. Iterates each configured OU, paginating results to safely handle large directories.
  3. For each entry, resolves the local user via the configured unique key (objectguid by default β€” immune to renames and OU moves).
  4. Applies attribute mapping and transformers, then creates or updates the Eloquent model.
  5. After all OUs are processed, applies the stale-user strategy to local users no longer present in AD.
  6. Fires events and writes a sync report.

πŸ§ͺ Testing

The test suite uses LdapRecord's built-in directory emulator, so no real LDAP server is required.


πŸ—ΊοΈ Roadmap


🀝 Contributing

Contributions are welcome! Please open an issue first to discuss what you would like to change, and make sure tests pass before submitting a PR.

πŸ”’ Security

If you discover a security vulnerability, please email [email protected] instead of using the issue tracker.

πŸ“„ License

The MIT License (MIT). See LICENSE.md for details.


Built with β˜• by Ismail Elbery β€” born from years of syncing Active Directory users in Laravel government systems.


All versions of laravel-ldap-sync with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
directorytree/ldaprecord-laravel Version ^3.0
spatie/laravel-package-tools Version ^1.16
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ismailelbery/laravel-ldap-sync contains the following files

Loading the files please wait ...