PHPackages                             nohnaimer/yii2-ldaprecord - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. nohnaimer/yii2-ldaprecord

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

nohnaimer/yii2-ldaprecord
=========================

Yii2 extension for library LdapRecord

0.3.1(2y ago)1211↓50%1BSD-3-ClausePHPPHP &gt;=8.1

Since Apr 6Pushed 2y ago1 watchersCompare

[ Source](https://github.com/nohnaimer/yii2-ldaprecord)[ Packagist](https://packagist.org/packages/nohnaimer/yii2-ldaprecord)[ Docs](https://github.com/nohnaimer/yii2-ldaprecord)[ RSS](/packages/nohnaimer-yii2-ldaprecord/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (18)Used By (0)

Yii2 LdapRecord extension
=========================

[](#yii2-ldaprecord-extension)

[![Latest Stable Version](https://camo.githubusercontent.com/e92cd39805aa6290f909650baf35aa9a9fe5f67d8db302456c93148cea8e6e2f/68747470733a2f2f706f7365722e707567782e6f72672f6e6f686e61696d65722f796969322d6c6461707265636f72642f762f737461626c65)](https://packagist.org/packages/nohnaimer/yii2-ldaprecord)[![License](https://camo.githubusercontent.com/5ac2347525e29c01a6c857f20610e621d12f937fdfbbaf7218183c5dba33b7e5/68747470733a2f2f706f7365722e707567782e6f72672f6e6f686e61696d65722f796969322d6c6461707265636f72642f6c6963656e7365)](https://packagist.org/packages/nohnaimer/yii2-ldaprecord)[![Total Downloads](https://camo.githubusercontent.com/c12a4ac3bbe8ee6d3ffab6d6594baf3e09f176d4d148162da25148a277fcef25/68747470733a2f2f706f7365722e707567782e6f72672f6e6f686e61696d65722f796969322d6c6461707265636f72642f646f776e6c6f616473)](https://packagist.org/packages/nohnaimer/yii2-ldaprecord)

[Documentation](https://ldaprecord.com/docs/) for LdapRecord

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

```
php composer.phar require --prefer-dist nohnaimer/yii2-ldaprecord "*"

```

or add

```
"nohnaimer/yii2-ldaprecord": "*"

```

to the require section of your `composer.json` file.

Configuration
-------------

[](#configuration)

```
'components' => [
...
'ldap' => [
            'class' => nohnaimer\ldaprecord\LdapRecord::class,
            'providers' => [
                'ad' => [
                    'class' => nohnaimer\ldaprecord\LdapRecord::class,
                     // Mandatory Configuration Options
                     'hosts'            => ['192.168.1.1'],
                     'base_dn'          => 'dc=local,dc=com',
                     'username'         => 'admin@local.com',
                     'password'         => 'password',

                     // Optional Configuration Options
                     'port'             => 389,
                     'follow_referrals' => false,
                     'use_ssl'          => false,
                     'use_tls'          => false,
                     'version'          => 3,
                     'timeout'          => 5,

                     // Custom LDAP Options
                     'options' => [
                         // See: http://php.net/ldap_set_option
                         LDAP_OPT_X_TLS_REQUIRE_CERT => LDAP_OPT_X_TLS_HARD
                     ],
                ],
                'ldap' => [
                    'hosts' => ['192.168.1.2'],
                    'base_dn' => 'dc=local,dc=com',
                    'username' => 'cn=admin,dc=mts,dc=by',
                    'password' => 'password',

                    // Optional Configuration Options
                    'port' => 389,
                    'version' => 3,

                    // Custom LDAP Options
                    'options' => [
                        // See: http://php.net/ldap_set_option
                        LDAP_OPT_X_TLS_REQUIRE_CERT => LDAP_OPT_X_TLS_HARD
                    ],
                ],
            ],
        ],
...
],
```

Usage
-----

[](#usage)

Simple usage without a user model

Query:

```
Yii::$app->ldap->initProvider('ad')->query()->where('cn', '=', 'John Doe')->get();
```

Authentication:

```
Yii::$app->ldap->initProvider('ad')->auth()->attempt('username', 'password', true);
```

Simple usage with a model

Model:

```
class User extends \LdapRecord\Models\ActiveDirectory\User
{
    /**
     * The "booting" method of the model.
     * @throws \LdapRecord\Auth\BindException
     * @throws \LdapRecord\ConnectionException
     */
    protected static function boot()
    {
        Yii::$app->ldap->initProvider('ad');
    }

    protected $connection = 'ad';
}
```

```
$user = User::findByGuid('guid');
```

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~74 days

Recently: every ~147 days

Total

17

Last Release

1089d ago

PHP version history (4 changes)0.0.1PHP &gt;=5.5.0

0.2.2PHP &gt;=7.2

0.2.8PHP &gt;=8.0

0.3.0PHP &gt;=8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8865830?v=4)[Maksim Astapenko](/maintainers/nohnaimer)[@nohnaimer](https://github.com/nohnaimer)

---

Top Contributors

[![nohnaimer](https://avatars.githubusercontent.com/u/8865830?v=4)](https://github.com/nohnaimer "nohnaimer (28 commits)")

---

Tags

yii2extensionldapactive directoryopenldapldaprecord

### Embed Badge

![Health badge](/badges/nohnaimer-yii2-ldaprecord/health.svg)

```
[![Health](https://phpackages.com/badges/nohnaimer-yii2-ldaprecord/health.svg)](https://phpackages.com/packages/nohnaimer-yii2-ldaprecord)
```

###  Alternatives

[directorytree/ldaprecord-laravel

LDAP Authentication &amp; Management for Laravel.

5752.3M18](/packages/directorytree-ldaprecord-laravel)[ldaptools/ldaptools

LdapTools is a feature-rich LDAP library for PHP 5.6+.

205268.8k1](/packages/ldaptools-ldaptools)[chrmorandi/yii2-ldap

Ldap

1454.3k](/packages/chrmorandi-yii2-ldap)[dmstr/yii2-cookie-consent

Yii2 Cookie Consent Widget

1455.6k](/packages/dmstr-yii2-cookie-consent)[imanilchaudhari/yii2-currency-converter

This extension will help to find out current currency conversion rate.

2111.7k](/packages/imanilchaudhari-yii2-currency-converter)[richardfan1126/yii2-js-register

Yii2 widget to register JS into view

1359.3k7](/packages/richardfan1126-yii2-js-register)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
