- Is fbeen/uniqueslugbundle a Laravel package?
- No. It is a Symfony bundle built around Doctrine entities and @Slug annotations, so it does not register a Laravel service provider, participate in package discovery, or hook into Eloquent model events. The Bundle suffix and annotation vocabulary are a strong signal that the integration target is Symfony, not Laravel. Adopting it in a Laravel application means porting the logic rather than installing a dependency.
- Can I install fbeen/uniqueslugbundle with Composer in a Laravel project?
- composer require fbeen/uniqueslugbundle will resolve if the version constraints allow it, but nothing will be auto-discovered and no config file, facade, or migration is published for Laravel. You would be wiring classes manually and rewriting annotation-driven behaviour to work with Eloquent models. Treat this as a vendoring exercise rather than a normal package install.
- Does fbeen/uniqueslugbundle ship a database migration with a unique index on the slug column?
- The package is annotation-driven and nothing in the repository metadata indicates a shipped migration or schema tooling. That matters because application-level uniqueness checks are only advisory without a unique index on the slug column, and concurrent writes can insert duplicates. If you adopt or reimplement the logic, add the composite or single-column unique index yourself.
- How does fbeen/uniqueslugbundle handle slug collisions?
- For this class of package the usual approach is a SELECT followed by an INSERT, appending a numeric or random suffix when a match is found, which is a check-then-act race. Under concurrent requests two inserts can both pass the check and one will fail against the unique index unless the retry loop is bounded and exception-aware. Verify the actual strategy in the source before relying on it in production.
- Is this package maintained, and does it support PHP 8 and Laravel 8 or newer?
- The last tagged release is from 2019-11-05, the repository has roughly four stars and zero dependents, so there is no public production reference or downstream testing against modern framework versions. There is no CI signal indicating PHP 8 or Laravel 8+ were ever targeted. Practically, adoption means forking the code and owning it yourself.
- What are the best alternatives for generating unique slugs in Laravel?
- spatie/laravel-sluggable and cviebrock/eloquent-sluggable are actively maintained, widely depended on, and integrate with Eloquent events and route model binding out of the box. Because unique slug generation is realistically 80 to 150 lines of trait plus index code, writing it in-house is also a credible option that keeps your dependency surface at zero.
- Can I scope slug uniqueness per tenant or per parent record?
- There is no evidence of scoping support; the stated goal is a unique slug for a field, which in practice means global uniqueness within the table. Multi-tenant or nested-resource routes usually need uniqueness per store or per parent, which requires a composite unique index and a scoped lookup. Assume you will have to add that yourself.
- What happens to existing URLs when a slug changes?
- Nothing in the package provides a redirect table or slug history, so changing a title and regenerating its slug silently breaks every inbound link and the SEO value attached to the old permalink. If permalinks matter you need to preserve the previous slug, store it in a redirects table, and resolve historic slugs before the 404 handler runs. That is application code, not something this bundle covers.
- How does it treat soft-deleted records and slug recycling?
- Soft deletes interact badly with unique slug generation because a trashed row still occupies the unique index. Without explicit handling you either cannot reuse the slug while the row is soft-deleted, or you hit a constraint violation when the model is restored and the slug has since been reassigned. Test that behaviour before adopting, and consider suffixing on restore.
- Does it transliterate non-Latin titles such as Chinese or Arabic?
- The overview says nothing about transliteration, and annotation-based sluggers commonly rely on a simple lowercase-and-replace regex that can strip an entire CJK or Arabic title down to an empty string. An empty slug then violates the unique index or produces an unusable route. Test with your real content, and if you need it, add a transliteration step with a fallback identifier before persisting.