protected function retrieveAuthenticatedUser($username)
    {
        // Find the user in LDAP.
        if ($user = $this->resolveUserByUsername($username)) {
            $provider = $this->auth->getProvider();

            if ($provider instanceof NoDatabaseUserProvider) {
                $this->fireAuthenticatedEvent($user);

                return $user;
            } elseif ($provider instanceof DatabaseUserProvider) {
                // Here we'll import the LDAP user. If the user already exists in
                // our local database, it will be returned from the importer.
                $model = Bus::dispatch(
                    new Import($user, $this->model())
                );

                // We'll sync / set the users password after
                // our model has been synchronized.
                Bus::dispatch(new SyncPassword($model));

                // We also want to save the returned model in case it doesn't
                // exist yet, or there are changes to be synced.
                $model->save();

                $this->fireAuthenticatedEvent($user, $model);

                return $model;
            }
        }
    }
protected function retrieveAuthenticatedUser($username)
    {
        // Find the user in LDAP.
        if ($user = $this->resolveUserByUsername($username)) {
            $provider = $this->auth->getProvider();

            if ($provider instanceof NoDatabaseUserProvider) {
                $this->fireAuthenticatedEvent($user);

                return $user;
            } elseif ($provider instanceof DatabaseUserProvider) {
                // Here we'll import the LDAP user. If the user already exists in
                // our local database, it will be returned from the importer.
                $model = Bus::dispatch(
                    new Import($user, $this->model())
                );

                // We'll sync / set the users password after
                // our model has been synchronized.
                Bus::dispatch(new SyncPassword($model));

                // We also want to save the returned model in case it doesn't
                // exist yet, or there are changes to be synced.
                $model->save();

                $this->fireAuthenticatedEvent($user, $model);

                return $model;
            }
        }
    }
protected function retrieveAuthenticatedUser ( $ username ) { // Find the user in LDAP. if ( $ user = $ this -> resolveUserByUsername ( $ username ) ) { $ provider = $ this -> auth -> getProvider ( ) ; if ( $ provider instanceof NoDatabaseUserProvider ) { $ this -> fireAuthenticatedEvent ( $ user ) ; return $ user ; } elseif ( $ provider instanceof DatabaseUserProvider ) { // Here we'll import the LDAP user. If the user already exists in // our local database, it will be returned from the importer. $ model = Bus :: dispatch ( new Import ( $ user , $ this -> model ( ) ) ) ; // We'll sync / set the users password after // our model has been synchronized. Bus :: dispatch ( new SyncPassword ( $ model ) ) ; // We also want to save the returned model in case it doesn't // exist yet, or there are changes to be synced. $ model -> save ( ) ; $ this -> fireAuthenticatedEvent ( $ user , $ model ) ; return $ model ; } } }
Returns the authenticatable user instance if found.

@param string $username

@return \Illuminate\Contracts\Auth\Authenticatable|null
Returns the authenticatable user instance if found .