Integrate LDAP into your PHP applications

No hair-pulling necessary.

$user = User::create([
    'cn' => 'Steve Bauman',
    'company' => 'Acme',
    'password' => 'P@ssw0rd',

$administrators = Group::find('cn=Admins,dc=acme,dc=org');

use LdapRecord\Connection;

$connection = new Connection([
    'hosts' => [''],
    'base_dn' => 'dc=local,dc=com',
    'username' => 'cn=user,dc=local,dc=com',
    'password' => 'SuperSecret',


$users = $connection->query()->where('title', '=', 'Accountant')->get();

Up and running fast

Effortlessly connect to your LDAP servers and start running queries & operations faster than dial up.

Fluent Query Builder

Building LDAP queries has never been so easy. Find the objects you're looking for in a couple lines or less with a fluent interface.

    ->whereNotContains('company', 'Acme')
    ->each(function ($user) {
        $user->company = 'Acme Organization';

$user = new User();

$user->cn = 'Steve Bauman';
$user->title = 'Developer';
$user->samaccountname = 'sbauman';
$user->company = 'Acme';
$user->mail = '';
$user->givenname = 'Steve';
$user->sn = 'Bauman';
$user->password = 'Super-Secret';


Supercharged Active Record

Create and modify LDAP objects with ease. All LDAP objects are individual models. Simply modify the attributes on the model and save it to persist the changes to your LDAP server.