getcodedev/test-levenshtein

This is my package test-levenshtein

1.0.4 2022-05-30 08:11 UTC

README

68747470733a2f2f6769746875622d6164732e73332e65752d63656e7472616c2d312e616d617a6f6e6177732e636f6d2f737570706f72742d756b7261696e652e7376673f743d31

This is my package test-levenshtein

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

This is where your description should go. Limit it to a paragraph or two. Consider adding a small example.

Installation

You can install the package via composer:

composer require getcodedev/test-levenshtein

You can publish and run the migrations with:

php artisan vendor:publish --tag="test-levenshtein-migrations"
php artisan migrate

Usage

$duplicates = check_duplicates(
    model: User::class,
    search: [
        'first_name' => 'John',
        'home' => [
            'address' => "bbbbb, rrr BB, 77777",
        ],
    ],
    concat_search_columns: [
        'home' => [
            'address' => 'homes.street, homes.city homes.state, homes.zip',
        ],
    ],
    priority_columns: [
        'homes.address',
        'users.first_name',
    ],
    with_similarity_min_common: 50,
    limit: 10
);

Testing

# 1. clone this package && run composer install
composer install

# 2. Then need to set configs for mysql connection in phpunit.xml
cp phpunit.xml.dist phpunit.xml

# 3. Run tests
composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.