protected function findUser()
    {
        $query = $this->model->newQuery();

        if ($query->getMacro('withTrashed')) {
            // If the withTrashed macro 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.
            $query->withTrashed();
        }

        /** @var \Illuminate\Database\Eloquent\Scope $scope */
        $scope = new static::$scope(
            $this->getUserObjectGuid(),
            $this->getUserUsername()
        );

        $scope->apply($query, $this->model);

        return $query->first();
    }
protected function findUser()
    {
        $query = $this->model->newQuery();

        if ($query->getMacro('withTrashed')) {
            // If the withTrashed macro 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.
            $query->withTrashed();
        }

        /** @var \Illuminate\Database\Eloquent\Scope $scope */
        $scope = new static::$scope(
            $this->getUserObjectGuid(),
            $this->getUserUsername()
        );

        $scope->apply($query, $this->model);

        return $query->first();
    }
protected function findUser ( ) { $ query = $ this -> model -> newQuery ( ) ; if ( $ query -> getMacro ( 'withTrashed' ) ) { // If the withTrashed macro 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. $ query -> withTrashed ( ) ; } /** @var \Illuminate\Database\Eloquent\Scope $scope */ $ scope = new static :: $ scope ( $ this -> getUserObjectGuid ( ) , $ this -> getUserUsername ( ) ) ; $ scope -> apply ( $ query , $ this -> model ) ; return $ query -> first ( ) ; }
Retrieves an eloquent user by their GUID or their username.

@return Model|null

@throws UnexpectedValueException
Retrieves an eloquent user by their GUID or their username .