ADLDAP2 для Laravel 5.2 — привязка пользователя к модели

Я впервые использую ADLDAP & Я только что поработал над Laravel, так что я запутался.

Примечания в файле конфигурации говорят это:

    /*
|--------------------------------------------------------------------------
| Bind User to Model
|--------------------------------------------------------------------------
|
| The bind user to model option allows you to access the Adldap user model
| instance on your laravel database model to be able run operations
| or retrieve extra attributes on the Adldap user model instance.
|
| If this option is true, you must insert the trait:
|
|   `Adldap\Laravel\Traits\AdldapUserModelTrait`
|
| Onto your User model configured in `config/auth.php`.
|
| Then use `Auth::user()->adldapUser` to access.
|
| This option must be true or false.
|
*/

У меня вопрос, где / как мне добавить Adldap\Laravel\Traits\AdldapUserModelTrait черта в файле config / auth.php?

3

Решение

Вы не используете его внутри вашего файла конфигурации аутентификации. Но вы импортируете его в свою модель пользователя. Так

use Adldap\Laravel\Traits\AdldapUserModelTrait;

class User extends Authenticatable {
use AdldapUserModelTrait;
}
2

Другие решения

Других решений пока нет …