risav's avatar
Level 1

Password::sendResetLink not working

Hello, I have followed this https://medium.com/cs-code/laravel-7-forgot-password-apis-using-inbuilt-laravel-methods-e628f0191254 for password reset. The problem is it says "Reset password link sent on your email id." and I haven't received the mail.

I have tried by sending mail from command line as in this https://atymic.dev/tips/laravel-send-test-email/ and received mail. Now I want to get my password reset mail.​

Code snippet for password reset

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Password;
use Illuminate\Support\Facades\Hash;

class ForgotPasswordController extends Controller
{
    public function forgot() {
        $credentials = request()->validate(['email' => 'required|email']);
        
        Password::sendResetLink($credentials);

        return response()->json(["msg" => 'Reset password link sent on your email id.']);
    }

​```
0 likes
1 reply

Please or to participate in this conversation.