我需要在创建新用户后发送电子邮件。Laravel电子邮件注册确认
但我不知道如何返回到主页没有出现错误。 这就是我现在正在做的。
User::create([
'name' => $data['name'],
'username' => $data['username'],
'email' => $data['email'],
'password' => bcrypt($data['password']),
'phone' => bcrypt($data['phone']),
'confirmation_code' => str_random(30),
]);
Email_function();
if (Auth::attempt(['email' => $data['email'], 'password' => bcrypt($data['password']) ])) {
// Authentication passed...
return redirect('/');
}
我一直把这个当作我的错误信息。
SErrorException in SessionGuard.php line 439:
Argument 1 passed to Illuminate\Auth\SessionGuard::login() must implement interface Illuminate\Contracts\Auth\Authenticatable, null given, called in /Applications/XAMPP/xamppfiles/htdocs/sniddl/vendor/laravel/framework/src/Illuminate/Foundation/Auth/RegistersUsers.php on line 63 and defined
编辑: 改变了标题,以反映答案。
哪里是错误的休息吗? – Devon
我现在加了。对于那个很抱歉。 – CriticalTheWizard
这是RegistersUser的第63行吗? auth :: attempt? – Devon