Authentication Laravel Auth::检查不';当雄辩的模型名称为';账户';不是';用户';

Authentication Laravel Auth::检查不';当雄辩的模型名称为';账户';不是';用户';,authentication,laravel-4,eloquent,Authentication,Laravel 4,Eloquent,我的用户数据库表名为“account”(我对所有内容都使用单数名称),“account”是用于身份验证的模型名。我在模型上定义了table属性,并更改了config/auth.php,如下所示: class Account extends Ardent implements UserInterface, RemindableInterface { protected $guarded = array( 'id', // the key is just 'id' so should b

我的用户数据库表名为“account”(我对所有内容都使用单数名称),“account”是用于身份验证的模型名。我在模型上定义了table属性,并更改了config/auth.php,如下所示:
class Account extends Ardent implements UserInterface, RemindableInterface 
{
protected $guarded = array(
    'id',  // the key is just 'id' so should be ok
    'password'
//...
    protected $table = 'account';
//...
}
<?php # config/auth.php
return array(
    'driver' => 'eloquent',
    'model' => 'Account',
    'table' => 'account',  
//...
}
我在header视图中还有一段代码,它引用Auth::check()来显示登录或注销链接,但它似乎总是返回false,因此登录链接是为登录用户显示的。Auth::尝试登录用户时效果良好。我错过了什么


2013年12月18日编辑 虽然我发现我犯的两个错误是相关的,但它们都没有解决问题,但在这里,它们加上了来自migrator的一个有趣错误,我认为这可能值得比我聪明得多的人关注。
首先,我的两个相关错误:

1-在
bootstrap/start.php
中,在envt检测中,我有
的“测试”=>数组(“*local*”)
,这导致会话无法使用

2-我有一个错误的关闭
}
错误地引导我进入一个成功登录页面,而事实上没有成功登录。所以在我最初的帖子中,我说尝试部分起作用的地方是不正确的。事实并非如此

这是更有趣的部分。我更改了我的
nnn\u create\u account\u表
migration,将密码更改为
string('password',64)
,然后尝试运行
migrate:refresh
migrate:reset
,这两个表都出现了以下错误:

“message”:”Class 'CreateUsersTable' not found”,”file”:”(...project_dir...)\vendor\laravel\framework\src\Illuminate\Database\Migrations\Migrator.php”,”line”:301
然后我搜索了整个项目文件夹,除了在一些日志中,在任何地方都找不到文本“CreateUsersTable”。拉威尔为什么要这样做?是虫子吗? 我最后运行了一个简单的
migrate
命令(没有刷新或重置命令的一部分),它工作了,或者至少在CLI上没有出现错误,但我使用Auth方法的代码仍然无法工作


我将继续前进,将使用这个起步平台并尝试基于它构建我的应用程序。对于我的用户表,我将放弃使用“用户”而不是“帐户”

请查看以下内容:。阅读Amirth的文章默认用户模型extensed-elount()@Fractaliste-Ardent extensed-elount是一个验证助手。[连结]
“message”:”Class 'CreateUsersTable' not found”,”file”:”(...project_dir...)\vendor\laravel\framework\src\Illuminate\Database\Migrations\Migrator.php”,”line”:301