- What is keyvanakbary/slugifier and what does it do?
- keyvanakbary/slugifier is a lightweight PHP library that turns text into clean, URL-friendly slugs using a pure functional approach. It supports UTF-8 transliteration and customizable separators and transformations. It works standalone or in Laravel via Composer, but it is not a full slug-management solution for uniqueness, persistence, redirects, or SEO policy.
- How do I install keyvanakbary/slugifier in a Laravel project?
- Install it with Composer using the package name keyvanakbary/slugifier. Before adopting it, inspect its composer.json for PHP constraints, autoloading, and required extensions because the last release was in 2015. In Laravel, bind it behind an application-owned interface or service provider instead of scattering direct calls through controllers, models, or jobs.
- Is keyvanakbary/slugifier compatible with Laravel 10, 11, or 12?
- The package has no clearly stated modern Laravel support in the assessment, and its 2015 release date suggests PHP 5-era assumptions. You must run a compatibility spike against your exact PHP and Laravel versions before relying on it. If Composer compatibility fails, consider porting the MIT-licensed logic into an internal utility or using Laravel's native Str::slug.
- Which PHP versions and extensions does keyvanakbary/slugifier require?
- The provided context does not list exact PHP version constraints or required extensions, so inspect the package composer.json directly. Given the 2015 release, assume it may target older PHP versions and verify PHP 8+ behavior under your production runtime. Also confirm any transliteration-related extension requirements before rollout.
- Does keyvanakbary/slugifier handle UTF-8, accents, CJK, and emoji?
- It advertises UTF-8 transliteration, but the assessment does not confirm deterministic handling of accents, CJK characters, emoji, punctuation, or maximum-length rules. Add contract tests with representative inputs and compare outputs against Laravel's Str::slug or your current generator. Define expected fallback behavior for empty or unusual slugs.
- How do I customize the separator or slug transformations in keyvanakbary/slugifier?
- The package supports customizable separators and transformations, but the exact API should be confirmed from its source or README. Keep configuration inside an application-owned slug generator so separator, length, locale, and reserved-word policy stay centralized. Test the customized output across whitespace, casing, punctuation, and Unicode inputs.
- Does keyvanakbary/slugifier handle duplicate slugs or collisions?
- No, it is a pure slug generator, so uniqueness and collision resolution remain the application's responsibility. Use database unique constraints, a suffixing strategy, reserved-word checks, and duplicate-input tests in your own code. Also cover empty-slug edge cases because the package does not provide a full slug-management workflow.
- How does keyvanakbary/slugifier compare with Laravel's Str::slug?
- Str::slug is native to Laravel, maintained with the framework, and is generally the safer default for Laravel applications. keyvanakbary/slugifier is a small functional utility but is effectively unmaintained upstream and lacks Laravel-specific integration. Baseline both against real inputs before switching, and use an adapter if you want an exit path back to Str::slug.
- Is keyvanakbary/slugifier safe and maintained for production use?
- Runtime security exposure is low for a pure slugifier, but lifecycle risk is high because the last release was in 2015, adoption is low, and provenance should be reviewed. Pin the version or vendor a fork, assign an internal owner, and keep an exit path to Laravel's native helper or an internal implementation. No vendor SLA or active community support should be expected.
- How should I test or migrate to keyvanakbary/slugifier in an existing Laravel app?
- Run a short compatibility and behavior spike covering accents, CJK, emoji, punctuation, whitespace, casing, length limits, duplicates, and empty output. Wrap the package behind an internal SlugGenerator contract and shadow-compare its output with your current strategy before changing production writes. If you proceed, use idempotent backfill jobs only when justified and keep rollback checkpoints.