Laravel 4.2 身份验证:尝试失败


Laravel 4.2 auth: attempt fails

身份验证总是失败(总是打印错误 - 请参阅下面的最后一个代码块)。我已经在StackOverflow上尝试了数十种解决方案。

谁能帮我弄清楚问题是什么?

我的用户模型

use Illuminate'Auth'UserTrait;
use Illuminate'Auth'UserInterface;
use Illuminate'Auth'Reminders'RemindableTrait;
use Illuminate'Auth'Reminders'RemindableInterface;
class User extends Eloquent implements UserInterface, RemindableInterface {
use UserTrait, RemindableTrait;
/**
 * The database table used by the model.
 *
 * @var string
 */
protected $table = 'usersnew';
/**
 * The attributes excluded from the model's JSON form.
 *
 * @var array
 */
protected $hidden = array('password', 'remember_token');

我的身份验证.php

return array(
/*
|--------------------------------------------------------------------------
| Default Authentication Driver
|--------------------------------------------------------------------------
|
| This option controls the authentication driver that will be utilized.
| This driver manages the retrieval and authentication of the users
| attempting to get access to protected areas of your application.
|
| Supported: "database", "eloquent"
|
*/
'driver' => 'eloquent',
/*
|--------------------------------------------------------------------------
| Authentication Model
|--------------------------------------------------------------------------
|
| When using the "Eloquent" authentication driver, we need to know which
| Eloquent model should be used to retrieve your users. Of course, it
| is often just the "User" model but you may use whatever you like.
|
*/
'model' => 'User',
/*
|--------------------------------------------------------------------------
| Authentication Table
|--------------------------------------------------------------------------
|
| When using the "Database" authentication driver, we need to know which
| table should be used to retrieve your users. We have chosen a basic
| default value but you may easily change it to any table you like.
|
*/
'table' => 'users',
/*
|--------------------------------------------------------------------------
| Password Reminder Settings
|--------------------------------------------------------------------------
|
| Here you may set the settings for password reminders, including a view
| that should be used as your password reminder e-mail. You will also
| be able to set the name of the table that holds the reset tokens.
|
| The "expire" time is the number of minutes that the reminder should be
| considered valid. This security feature keeps tokens short-lived so
| they have less time to be guessed. You may change this as needed.
|
*/
'reminder' => array(
    'email' => 'emails.auth.reminder',
    'table' => 'password_reminders',
    'expire' => 60,
),

我尝试运行的函数:

$input = Input::all();
    $attempt = Auth::attempt( array('email' => $input['email'], 'password' => $input['password']) );
    if($attempt) {
        echo 123;
    } else {
        echo 'bad';
    }
我要

感谢Saint Genius和joe_archer显然,如果我不使用散列密码身份验证不起作用......

非常感谢你们!