Laravel 4 Auth:Versuch nicht funktioniert

Ich habe harte Zeit der Arbeit mit Laravel 4 Auth::Versuch-Methode , gefolgt, die richtige Dokumentation, Lesen paar SO threads aber ich bin noch nicht in der Lage, um es arbeiten.

$userData = array('email' => '[email protected]','password' => 'admin');
if(Auth::attempt($userData)){
    //redirect
}
else{
   echo 'Invalid';
}

Und es gibt Ungültiger jedesmal, wenn

Nun bin ich nicht sicher, was ist der eigentliche Grund.

In meinem config/auth.php ich habe folgende

<?php

   return array(
/*
|--------------------------------------------------------------------------
| Default Authentication Driver
|--------------------------------------------------------------------------
|
| This option controls the authentication driver that will be utilized.
| This drivers 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.
|
*/
'reminder' => array(
    'email' => 'emails.auth.reminder', 'table' => 'password_reminders',
),
 );
 ?>
  • Ich habe Euch gesagt, die Antwort auf Ihre Frage, downvote alles, was Sie wollen. Der array-Schlüssel sind falsch, yoyur login halten scheitern. Spaß haben.
  • Sie sollten sich keine sorgen über die unten abstimmen, dnt u denke, wenn Sie versucht haben mehrere Kombinationen, auch per E-Mail oder Benutzername ist nicht erforderlich option atleast in laravel4, laravel.com/docs/security. Lesen Sie dieses Dokument zu erhalten, besser zu verstehen....
  • Ich denke, du meintest einen link zu Laravel 4 in der Dokumentation. ich bin in einem ähnlichen Problem gerade jetzt. Ich werde versuchen, hier zu posten, sobald ich es herausgefunden.
InformationsquelleAutor Aman Virk | 2013-06-04
Schreibe einen Kommentar