Check whether password is correct or not in Laravel

后端 未结 6 1629
傲寒
傲寒 2020-12-31 00:23

In laravel I want to check if user enter current password than check with that password which is store in database in that user data. If correct than continue otherwise give

6条回答
  •  不知归路
    2020-12-31 00:39

    1. Hit the server route with your AJAX call.
    2. Check the result of auth()->attempt($request->only('email', 'password'))
    3. Return JSON back with a message and HTTP status code (200 if it is successful, 400 if it failed).
    4. Show the message in the success() method to a div. If it is an error, show the error message inside the error() method to a div.

提交回复
热议问题