public static function user(array $authConfig, $username)
    {
        $model = $authConfig['model'];
        $fields = static::getFields($authConfig);

        if (is_array($fields) && count($fields) == 2) {
            return $model::where($fields[0], $username)->orWhere($fields[1], $username)->first();
        }

        return $model::where($fields[0], $username)->first();
    }
public static function user(array $authConfig, $username)
    {
        $model = $authConfig['model'];
        $fields = static::getFields($authConfig);

        if (is_array($fields) && count($fields) == 2) {
            return $model::where($fields[0], $username)->orWhere($fields[1], $username)->first();
        }

        return $model::where($fields[0], $username)->first();
    }
public static function user ( array $ authConfig , $ username ) { $ model = $ authConfig [ 'model' ] ; $ fields = static :: getFields ( $ authConfig ) ; if ( is_array ( $ fields ) && count ( $ fields ) == 2 ) { return $ model :: where ( $ fields [ 0 ] , $ username ) -> orWhere ( $ fields [ 1 ] , $ username ) -> first ( ) ; } return $ model :: where ( $ fields [ 0 ] , $ username ) -> first ( ) ; }
Get the user trying to authenticate.

@param array $authConfig
@param $username

@return mixed
Get the user trying to authenticate .