src/Helpers/ArrayHelper.php
public static function matches($keys = [], $array = []): array
    {
        if (!empty($keys) && !empty($array)) {
            $matchingProperties = [];

            foreach ($keys as $property) {
                if ($matchedAttribute = static::getValue($array, $property)) {
                    $matchingProperties[$property] = $matchedAttribute;
                }
            }

            return $matchingProperties;
        }

        return $array;
    }
public static function matches($keys = [], $array = []): array
    {
        if (!empty($keys) && !empty($array)) {
            $matchingProperties = [];

            foreach ($keys as $property) {
                if ($matchedAttribute = static::getValue($array, $property)) {
                    $matchingProperties[$property] = $matchedAttribute;
                }
            }

            return $matchingProperties;
        }

        return $array;
    }
public static function matches ( $ keys = [ ] , $ array = [ ] ) : array { if ( ! empty ( $ keys ) && ! empty ( $ array ) ) { $ matchingProperties = [ ] ; foreach ( $ keys as $ property ) { if ( $ matchedAttribute = static :: getValue ( $ array , $ property ) ) { $ matchingProperties [ $ property ] = $ matchedAttribute ; } } return $ matchingProperties ; } return $ array ; }
Finds matching values from two arrays

@param array $keys
@param array $array
@return array
Finds matching values from two arrays