我正在使用laravel作为api。
我想做的是实现重置密码功能。
代码执行得很好,但是我的表password_resets
为空。
我正在调试请求,一切正常。
我不明白。
能请你帮我吗?
这是JSON:
[{"query":"delete from `password_resets` where `email` = ?","bindings":["xxxxxx@gmail.com"],"time":0.91},{"query":"insert into `password_resets` (`email`, `token`, `created_at`) values (?, ?, ?)","bindings":["xxxxxx@gmail.com","$2y$10$DTdz9EjAAEDkjsAuGLhsvukGxxrqhNiN1RCuf.3uTSowa1wr6k5VG",{"date":"2018-11-14 21:40:07.157813","timezone_type":3,"timezone":"UTC"}],"time":0.91}]
这是PHP后端:
public function getResetToken(Request $request)
{
$user = User::where('email', $request->input('email'))->first();
if (!$user) {
return 'KO';
}
DB::connection()->enableQueryLog();
$token = $this->broker()->createToken($user);
$queries = DB::getQueryLog();
return $queries;
}