不同的名称字段用户表? [英] Different name fields user table?
问题描述
我有2个字段(用户名,密码),并与2相同的字段(用户名,密码)的MySQL表形式,和我认证系统正常工作:)
不过,我不能让我的,如果表中的字段有不同的名称,例如它的工作:( my_user,MY_PASS )
如果你只需要改变在用户名在其他字段也适用于我,这给了我的问题是在密码字段。
我的配置的 auth.php 的
'司机'=> '雄辩'
更新
已经找到我的控制器解决方案,密码
名称不能改变。
在(错误的):
我已经在首位做是错误的。
$用户数据=阵列(
my_user'=>输入::得到('my_user'),
MY_PASS'=>输入::得到('MY_PASS')
);
应该是
$用户数据=阵列(
my_user'=>输入::得到('my_user'),
'密码'=>输入::得到('MY_PASS')
);
您可以定义你自己的 auth.php
的用户名和密码字段的config文件夹中。
回阵列(
'司机'=> '雄辩',
用户名= GT; my_user',
'密码'=> MY_PASS',
模式= GT; '用户',
'表'=> '用户',
);
我希望这能有所帮助。
I have a form with 2 fields (username, password) and a mysql table with those 2 same fields (username, password), and I authentication system working properly :)
But, I can not make it work if my table fields have different names, for example: (my_user, my_pass).
If you just change the username field on the other also works for me, that gives me problems is the password field.
My config auth.php
'driver' => 'eloquent'
Update
Already found the solution in my controller, the password
name can not change.
Before (WRONG): What I've done in first place was wrong
$userdata = array(
'my_user' => Input::get('my_user'),
'my_pass' => Input::get('my_pass')
);
it should be
$userdata = array(
'my_user' => Input::get('my_user'),
'password' => Input::get('my_pass')
);
You can define you own username and password field in the auth.php
inside the config folder.
return array(
'driver' => 'eloquent',
'username' => 'my_user',
'password' => 'my_pass',
'model' => 'User',
'table' => 'users',
);
I hope this can be of some help.
这篇关于不同的名称字段用户表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!