protected function newEloquentQuery($key, $username)
{
$model = $this->createModel();
if (method_exists($model, 'trashed')) {
// If the trashed method exists on our User model, then we must be
// using soft deletes. We need to make sure we include these
// results so we don't create duplicate user records.
$model = $model->withTrashed();
}
return $model->where([$key => $username]);
}