Php 认证laravel 4.2无法工作
验证laravel无法在我的程序上运行。我在谷歌上搜索过,但没有解决这个问题。我的节目是 LoginController@authPhp 认证laravel 4.2无法工作,php,authentication,laravel,laravel-4,Php,Authentication,Laravel,Laravel 4,验证laravel无法在我的程序上运行。我在谷歌上搜索过,但没有解决这个问题。我的节目是 LoginController@auth public function auth() { $username = Input::get('username'); $password = Input::get('pass'); if(Auth::attempt(array('id' => $username, 'password' => $password)))
public function auth()
{
$username = Input::get('username');
$password = Input::get('pass');
if(Auth::attempt(array('id' => $username, 'password' => $password)))
{
echo "Work";
}
else
{
echo "Bad";
}
}
Authtable.php
<?php
use Illuminate\Auth\UserInterface;
use Illuminate\Auth\Reminders\RemindableInterface;
class Authtable extends Eloquent implements UserInterface, RemindableInterface
{
protected $table = 'authtable';
protected $hidden = array('password');
/**
* Get the unique identifier for the user.
*
* @return mixed
*/
public function getAuthIdentifier()
{
return $this->getKey();
}
/**
* Get the password for the user.
*
* @return string
*/
public function getAuthPassword()
{
return $this->password;
}
/**
* Get the e-mail address where password reminders are sent.
*
* @return string
*/
public function getReminderEmail()
{
return $this->email;
}
public function getRememberToken()
{
return $this->remember_token;
}
public function setRememberToken($value)
{
$this->remember_token = $value;
}
public function getRememberTokenName()
{
return 'remember_token';
}
以及可为空的memore_令牌(varchar(100))、密码(varchar(60)),但仍然不起作用。请给出一些解决办法。我在这方面有过不好的经历
以确保模型名正常工作Composer dump autoload
- 检查模型名称是否没有冲突
- 检查“authtable”列名。这些列包括您输入的内容吗?
'id'=>$username,'password'=>$password
'driver' => 'eloquent',
'model' => 'Authtable',
'table' => 'authtable',