Here is a code snippet that I wrote to emulate the ldap in laravel.
AuthServiceProvider.php boot method
if (app()->isLocal()) {
$fake = DirectoryEmulator::setup('default');
$fake->getLdapConnection()->tls(true);
$user = User::create([
'cn' => fake()->name,
'givenName' => fake()->firstName,
'sn' => fake()->lastName,
'mail' => fake()->email,
'objectguid' => fake()->uuid,
'samaccountname' => fake()->username,
]);
Auth::login($user);
}