그래서 사용자를 만들 수 있었으므로 아무런 문제가 없습니다. 사용자의 이메일을 확인하는 확인 코드를 추가하고 싶습니다. 응용 프로그램에 링크가있는 사용자에게 전자 메일을 보내도록 할 수있었습니다. 한 사용자가 데이터베이스를 업데이트하는 링크를 클릭합니다. 다음은 사용자가 로그 아웃 할 때만 작동하는 문제입니다. 그들이 로그인했을 때 아무 일도 일어나지 않는 것 같습니다. 내가 로그 아웃 그가에 로그인하기 전에 확인하기 위해 새 사용자를 강제로하지 않을 어쨌든 여기 내 AuthController이다. 난 그냥 당신에게 생성 및 확인 방법을 보여주는하고사용자를위한 확인 코드가 작동하지 않습니다. Laravel 5.2
protected function create(array $data)
{
$confirmation_code = str_random(30);
$user = User::create([
'name' => $data['name'],
'email' => $data['email'],
'password' => bcrypt($data['password']),
'schoolid' => $data['schoolid'],
'confirmation_code' => $confirmation_code,
]);
Mail::send('emails.verify', compact('confirmation_code'), function($message) {
$message->to(Input::get('email'), Input::get('username'))->subject('Verify your email address');
});
return $user;
}
/**
* Attempt to confirm a users account.
*
* @param $confirmation_code
*
* @return mixed
*/
public function confirm($confirmation_code) {
$user = User::where('confirmation_code', $confirmation_code)->first();
$user->confirmed = 1;
$user->confirmation_code = null;
$user->save();
return redirect('/');
}
}
. 더 많은 코드가 필요하면 알려주세요. 그러나, 내 문제는이 코드에서있을 수 있습니다 믿습니다. 도움을 주셔서 감사합니다
트릭을 만들었습니다. 도와 줘서 고마워. – Chase