我正在开发一个用户可以在付款后注册的应用程序,下面是RegisterController
protected function create(array $data)
{
$payment = $this->MakePayment($data);
if($payment->error)
{
flash($payment->error, 'error')->important();
redirect()->route('register');
}
else
{
//create user and return it
return $user;
}
}
但是我得到了异常而不是返回
(1/1)FatalThrowableError
类型错误:传递给Illuminate \ Auth \ SessionGuard :: login()的参数1必须是Illuminate \ Contracts \ Auth \ Authenticatable的实例,null给定,在/home/tariqmahmood/www/local.referralfactorypro.com中调用第35行/vendor/laravel/framework/src/Illuminate/Foundation/Auth/RegistersUsers.php
另外,我在重定向后尝试了exit(),它返回注册路由但是空屏幕。任何人都可以让我知道我做错了什么。
答案 0 :(得分:0)
试试这个:
$authUser = //create user into db (i.e user::insert('userData'))
Auth::login($authUser, true);
return redirect('youtRedirectUrl');