簡體   English   中英

用於Laravel 5.2的ADLDAP2 - 將用戶綁定到模型

[英]ADLDAP2 for Laravel 5.2 - Binding user to model

這是我第一次使用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.
|
*/

我的問題是在config / auth.php文件中我在哪里/如何添加Adldap\\Laravel\\Traits\\AdldapUserModelTrait特征?

您不在auth配置文件中使用它。 但是您可以在用戶模型中導入它。 所以

use Adldap\Laravel\Traits\AdldapUserModelTrait;

class User extends Authenticatable {
    use AdldapUserModelTrait;
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM