bestmomo / laravel-email-confirmation

Add email confimation to Laravel project
89 stars 28 forks source link

Get a new confirmation email - not work! #4

Closed diominandrew closed 7 years ago

diominandrew commented 7 years ago

After editing the file RegistersUsers.php all work!

public function resend(Request $request) { if ($request->session()->has('user_id')) {

        $model = config('auth.providers.users.model');

        $user = $model::findOrFail($request->session()->get('user_id'));

    // add
    $user->confirmation_code = str_random(30);
    $user->save();
    //

        $this->notifyUser($user);

        return redirect(route('login'))->with('confirmation-success', trans('confirmation::confirmation.resend'));
    }

    return redirect('/');
}
bestmomo commented 7 years ago

Hello

The resend is only to get again the reset link and the user must already have the confirmation_code in users table, that is created on registration.

diominandrew commented 7 years ago

so on successful confirmation is deleted confirmation_code in users table

bestmomo commented 7 years ago

On successful confirmation why to ask for a resend ?

diominandrew commented 7 years ago

Excuse me. You're right. I had users before I installed your solution. Thank you for your work!