public function complete(UserInterface $user, $code)
{
$expires = $this->expires();
$activation = $this->createModel()->newQuery()->where('user_id', $user->getUserId())->where('code', $code)->where('completed', false)->where('created_at', '>', $expires)->first();
if ($activation === null) {
return false;
}
$activation->fill(['completed' => true, 'completed_at' => Carbon::now()]);
$activation->save();
return true;
}