src/AuthenUser.php
public function scopeFindByIdentifiers(Builder $query, $username): Builder
    {
        $identifiers = $this->getAuthIdentifiersName();

        $query->where(function ($query) use ($identifiers, $username) {
            foreach ($identifiers as $key) {
                $query->orWhere($key, '=', $username);
            }
        });

        return $query;
    }
public function scopeFindByIdentifiers(Builder $query, $username): Builder
    {
        $identifiers = $this->getAuthIdentifiersName();

        $query->where(function ($query) use ($identifiers, $username) {
            foreach ($identifiers as $key) {
                $query->orWhere($key, '=', $username);
            }
        });

        return $query;
    }
public function scopeFindByIdentifiers ( Builder $ query , $ username ) : Builder { $ identifiers = $ this -> getAuthIdentifiersName ( ) ; $ query -> where ( function ( $ query ) use ( $ identifiers , $ username ) { foreach ( $ identifiers as $ key ) { $ query -> orWhere ( $ key , '=' , $ username ) ; } } ) ; return $ query ; }
Find by identifiers scope.

@param  \Illuminate\Database\Eloquent\Builder  $query
@param  string|int  $username

@return \Illuminate\Database\Eloquent\Builder
Find by identifiers scope .