2016-09-21 8 views
3

これは私の初めてのADLDAPです。&私はいくつかのLaravelの作業を行っただけなので、混乱しています。設定ファイルにADLDAP2 for Laravel 5.2 - ユーザーをモデルにバインド

ノートには、これを言う:

/* 
|-------------------------------------------------------------------------- 
| 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. 
| 
*/ 

私の質問はどのように私は設定/ auth.phpファイルにAdldap\Laravel\Traits\AdldapUserModelTrait形質を追加する場所/ありますか?

答えて

2

auth設定ファイル内では使用しません。しかし、あなたのユーザーモデルでそれをインポートします。したがって

use Adldap\Laravel\Traits\AdldapUserModelTrait; 

class User extends Authenticatable { 
    use AdldapUserModelTrait; 
} 
+0

これは意味があります。 'あなたのユーザーモデルに設定する/ config.auth.phpで設定された特性を挿入する 'というコメントの言葉が私を混乱させました。ありがとう! – TH1981

+1

ここでAdldap2の著者。私はそれを明確にするために言葉遣いを変更します、提案のおかげで! –