【发布时间】:2016-04-01 21:42:57
【问题描述】:
I',将新系统集成到现有数据库中。
所以,我的用户表没有默认字段名称。
所有名称都是西班牙语,因此 Sentinel 在应该查找“correo”时会查找电子邮件
另外,在执行时
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
我找到的唯一资源是一个非常快的资源:
https://github.com/cartalyst/sentinel/wiki/Extending-Sentinel
上面说非常简单,但不要提这个案例。
那么,基本上,如何自定义 Sentinel 模型的所有字段名称???
这是我的模型:
class Administrador extends EloquentUser {
protected $table = 'administrador';
protected $fillable = [];
protected $guarded = ['administradorid'];
protected $hidden = ['contrasena', 'remember_token'];
use SoftDeletes;
protected $dates = ['deleted_at'];
}
任何帮助将不胜感激!
【问题讨论】:
标签: php laravel laravel-5 eloquent sentinel