php - attempt method doesn't work, laravel -


i using database table called "usuario" instead of "user", have managed register users, however, when try login , pass parameters attempt function, reason doesn't create session, made changes auth.php files , added name of table in model, may wrong?

this current code

public function login(request $data) {       if (auth::attempt(['email' => $data->email, 'clave' => $data->password])) {         // authentication passed...         return "success";         //return redirect()->intended('dashboard');     }else{         return "error";     } } 

should change else inside internal functions of laravel able authenticate other fields?

i wish can comment. lol
first, ensure run following command enable/activate authentication in laravel
php artisan make:auth
since you're not using user table, add following user model make use of table
public $table = "usuario";
check config/auth.php , run script again.


Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -