Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel String Similarities

Laravel String Similarities Laravel Package

atomescrochus/laravel-string-similarities

Compare strings in Laravel with a simple facade or helper. Get similarity scores and percentages using similar_text, levenshtein, soundex, metaphone and more, making fuzzy search, deduplication and typo-tolerant matching easy to build.

View on GitHub
Deep Wiki
Context7

Compare two string and get a similarity percentage

Frequently asked questions about Laravel String Similarities
How do I install atomescrochus/laravel-string-similarities in Laravel?
Install it with composer require atomescrochus/laravel-string-similarities. Laravel 5.5 and newer can use package auto-discovery, so no manual service provider registration is normally needed. There are no migrations, config files, or database dependencies to set up. Verify the package's Composer constraints against your PHP and Laravel versions before locking it in.
Which string similarity algorithms does this Laravel package support?
The package exposes a composite similarity percentage plus individual algorithms including Levenshtein, Hamming, Jaro-Winkler, longest common subsequence and substring, similar_text, soundex, and metaphone. The percentage is a heuristic blend rather than a calibrated probability. You should use the individual scores when you need more control over matching behavior.
How do I compare two strings and get a similarity percentage in Laravel?
Call the package's facade or helper with the two strings you want to compare. It returns a similarity percentage and can also expose results from individual algorithms. For production use, wrap the call in your own service so normalization rules and match thresholds stay consistent across your application.
Is laravel-string-similarities suitable for fuzzy search and typo-tolerant matching?
Yes, it fits bounded fuzzy search, typo-tolerant lookup, deduplication, record linkage, and name or address matching. It is not a complete search system, so you still need candidate generation and threshold tuning. Avoid naive all-pairs comparisons across large record sets because that becomes O(N squared) and CPU-bound.
Does laravel-string-similarities handle UTF-8 and non-English strings correctly?
You must validate UTF-8 and multibyte behavior against your own data before relying on it. The package does not include preprocessing such as case folding, punctuation stripping, transliteration, or Unicode normalization. Those steps are usually where match quality comes from, so implement them upstream and test with representative non-English strings.
What Laravel and PHP versions are supported by laravel-string-similarities?
The package is described as usable with Laravel 5.5 and newer through auto-discovery. The exact PHP and Laravel version matrix must be verified in its composer.json rather than assumed, because constraints may lag current releases. Pin the major version and commit your lockfile to avoid surprises.
Is the similarity percentage a calibrated confidence score?
No, the returned similarity percentage is a heuristic blend of string algorithms, not a calibrated probability. Thresholds need to be tuned on your own labeled data for each use case. Do not use it alone for compliance-grade identity matching or decisions that require calibrated confidence.
How does laravel-string-similarities perform on large datasets?
The algorithms are CPU-bound and generally O(n times m) per comparison, while naive pairwise comparison across a record set is O(N squared). The real performance risk is usually your call pattern rather than the library itself. Use blocking keys, trigram indexes, or phonetic candidate generation before comparing strings, and benchmark with realistic string lengths and record counts.
Is atomescrochus/laravel-string-similarities maintained and safe for production?
It is effectively a single-maintainer package with modest adoption, around 69 stars, under the MIT license. The main risk is abandonment rather than a correctness crisis, and the integration surface is small. Wrap it behind an internal interface and be prepared to vendor or fork it if maintenance stops.
Can I use laravel-string-similarities outside Laravel or replace it later?
The underlying string-similarity library is pure PHP and can be used outside Laravel, including in workers or CLI tools. The Laravel package itself is a thin service provider and facade wrapper. Put it behind an internal StringMatcher contract so you can swap in another library or an external matching service without changing call sites.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings