2016-03-21 16 views
1

私はLaravelプロジェクトでphp artisan make:authコマンドを使用して、これはApp\Models\User.php私の変わらないが、どのように見えるかです:委託のマニュアルに従って私はUser.phpファイルを変更する必要がありますは組み込みの認証システム

<?php 

namespace App\Models; 

use Illuminate\Foundation\Auth\User as Authenticatable; 

class User extends Authenticatable{ 

/** 
* The attributes that are mass assignable. 
* 
* @var array 
*/ 
protected $fillable = [ 
    'name', 'email', 'password', 
]; 

/** 
* The attributes excluded from the model's JSON form. 
* 
* @var array 
*/ 
protected $hidden = [ 
    'password', 'remember_token', 
];} 

<?php 

use Zizaco\Entrust\Traits\EntrustUserTrait; 

class User extends Eloquent 
{ 
    use EntrustUserTrait; // add this trait to your user model 

    ... 
} 

私は、Entrustユーザーロールを持つLaravelビルトインAuthシステムを使用したいと考えています。これらの2つをどのように組み合わせて一緒に作業することができますか?私が読んだとおり、複数の拡張を使用することはできません。任意の簡単なソリューション?

答えて

0

変更なしクラスApp\Models\Useruse EntrustUserTrait;に入れてください。

関連する問題