- Is jrk/levenshtein-bundle a Laravel package?
- No. It is a Symfony 2 bundle, not a Laravel package. It ships no service provider, facade, config publish tag, or package discovery metadata, so Laravel auto-discovery will not load it. Treat it as a reference implementation rather than a dependency.
- Can I install jrk/levenshtein-bundle with Composer in a Laravel app?
- You can require it with Composer, but Laravel will not register it. There is no Laravel service provider to boot. Its one real piece of functionality is a Doctrine ORM custom DQL function that expects a database-side LEVENSHTEIN routine, so Eloquent-native applications have nothing to integrate.
- What Laravel versions does jrk/levenshtein-bundle support?
- None officially. The package targets Symfony 2, which reached end of life in 2019. It has no Laravel version constraints, no package discovery, and no upgrade path. Do not expect compatibility with modern Laravel or Doctrine releases.
- How do I use Levenshtein distance for fuzzy search in Laravel?
- For Eloquent applications, use PHP's native levenshtein() or symfony/string's Levenshtein::distance() inside a job, comparator, or import validation step. For query-time filtering, define and version your own database function via a migration. Do not rely on this bundle for that.
- What does jrk/levenshtein-bundle actually provide?
- It wraps PHP's levenshtein() in a Symfony service, adds a Twig filter, supports configurable insert, replace, and delete costs, and includes a fuzzy matching helper for finding the closest candidate. It also contains a Doctrine DQL function. The DQL function is the only broadly extractable asset.
- Can I use the Doctrine LEVENSHTEIN DQL function in Laravel with laravel-doctrine?
- Only by extracting and rewriting the FunctionNode class against the Doctrine API you actually run. Register it with addCustomStringFunction() in a service provider. The Symfony 2-era contract has drifted through Doctrine 2.x and 3.x. You must also install a LEVENSHTEIN UDF or stored function in the database.
- Does jrk/levenshtein-bundle work on managed databases like RDS or Cloud SQL?
- Not without elevated privileges. The bundle expects a database-side LEVENSHTEIN routine. Managed platforms such as RDS, Aurora, Cloud SQL, and Azure often prohibit creating stored functions or installing UDFs. Confirm who owns that approval before spending engineering time.
- How do I test Levenshtein-based fuzzy matching in Laravel?
- Unit test your comparator, job, or import step with known string pairs and expected distances. For database-side functions, run integration tests against the real engine in CI. The bundle has no visible CI or test suite, so do not rely on its tests for confidence.
- What are good alternatives to jrk/levenshtein-bundle for Laravel?
- Use PHP's native levenshtein() for Eloquent applications, or symfony/string's Levenshtein::distance() available since 5.1. For query-time fuzzy filtering, write a team-owned database function via a migration. For large-scale ranking or typo tolerance, evaluate a dedicated search engine instead.
- Is jrk/levenshtein-bundle safe for production use?
- Risk is high. It has 2 stars, 0 dependents, a single maintainer, no visible CI, no security policy, and no CVE response. Symfony 2 is end-of-life. Treat the repository as a specification to copy from, not as a production dependency.