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
Post a Comment