I',將新系統集成到現有數據庫。自定義模型和字段與哨兵/ Laravel
所以,我的用戶表沒有默認的字段名稱。
所有的名字都在西班牙,因此,執行
Sentinel::check(),
我得到這個消息的錯誤時,哨兵查找電子郵件時,他應該找「郵報」
而且,:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'administrador.id' in 'where clause' (SQL: select * from `administrador` where `administrador`.`id` = 1 and `administrador`.`deleted_at` is null limit 1)
其實id不存在,這個PK叫做administradorid
唯一的reso urce我發現是一個非常快的一個:
https://github.com/cartalyst/sentinel/wiki/Extending-Sentinel
它說,它是很容易的極端,但沒有提到這種情況。
那麼,基本上,我該如何定製Sentinel Model的所有字段名?
這裏是我的模型:
class Administrador extends EloquentUser {
protected $table = 'administrador';
protected $fillable = [];
protected $guarded = ['administradorid'];
protected $hidden = ['contrasena', 'remember_token'];
use SoftDeletes;
protected $dates = ['deleted_at'];
}
任何幫助將不勝感激!
你重新rightttt我的壞PK ......我會嘗試週一告訴你! TX! –
它的工作原理。下一章,哈希方法是不一樣的 - > http://stackoverflow.com/questions/36407296/hash-password-compatibility-between-yii-php-crypt-and-laravel-sentines –