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
Slug Type Bundle

Slug Type Bundle Laravel Package

leapt/slug-type-bundle

Symfony bundle that adds a reusable SlugType form field for generating URL-friendly slugs from user input. It streamlines slug creation and validation in forms, helping keep routes and content identifiers clean, readable, and consistent across your application with minimal setup.

View on GitHub
Deep Wiki
Context7

Leapt SlugType bundle makes a form field dynamically generate the slug of another text field.

Frequently asked questions about Slug Type Bundle
Can I install leapt/slug-type-bundle in a Laravel application?
You can install it with Composer because it is MIT licensed and depends mainly on symfony/form, but nothing in a Laravel application will ever invoke its form type. The package is a Symfony bundle that registers through Symfony's DependencyInjection extension and bundle system, neither of which Laravel provides. Treat it as reference material for a UI behavior rather than a working dependency.
How does the SlugType form field generate a slug from another field?
SlugType is a Symfony AbstractType that you attach to a slug property and point at a sibling source field. A client-side listener on that source field transforms the typed value into a URL-friendly slug and writes it into the target input. The target stays a normal editable text field, so users can override the generated value before submitting.
Does leapt/slug-type-bundle support Laravel 11 or Laravel 12?
No. There is no Laravel support in the sense of a service provider, facade, Blade directive, or validation rule, and the package targets Symfony's Form component instead. Composer may still resolve it alongside a modern Laravel tree, but installing it adds dead weight with no Laravel integration point. If you want the behavior in Laravel, plan to reimplement roughly 20 to 40 lines of JavaScript in a Blade partial.
What should Laravel developers use instead for automatic slug generation?
On the server side, Laravel already ships Str::slug and the widely used spatie/laravel-sluggable package covers persistent slug generation on models. For the live in-form behavior, a small Alpine.js or vanilla JS listener on the source input reproduces what SlugType does. The build-versus-buy calculus clearly favors building here, since the front-end pattern is commodity work.
How do I install and register the bundle in a Symfony application?
Install it with Composer and enable the bundle in your bundles.php or config/bundles.php, following standard Symfony bundle registration. Once registered, the SlugType class is available to any form builder as a reusable field type. The bundle is lightweight, so there is no substantial configuration surface beyond using the type in your forms.
Does SlugType overwrite a slug the user has already edited manually?
The stated intent is that the slug remains editable and manual overrides are respected, which implies some guard against clobbering user edits. The exact detection mechanism is not documented in the overview, so verify whether it uses a dirty flag, a focus or blur event, or a value comparison. Read the shipped JavaScript directly before relying on this behavior, because a wrong guard is a real data-correctness bug.
Will slugs generated by this bundle match Laravel's Str::slug output?
Not guaranteed. Slugification is opinionated around transliteration, unicode handling, separator character, and maximum length, and the bundle's rules may differ from Str::slug in any of those areas. Silent divergence between a client-generated slug and a server-generated one is a genuine correctness problem for routes and unique constraints. Decide which side is authoritative and normalize on the server regardless of what the form field produces.
Does the slug behavior survive Livewire or Inertia re-renders?
That is unverified and likely to need work. The bundle ships behavior tied to Symfony form rendering and its asset conventions, not to Livewire component hydration or Inertia page visits. Any port should hook into the framework's lifecycle, such as Livewire's morph hooks or a component-mounted handler, so listeners are reattached after a re-render.
Is leapt/slug-type-bundle actively maintained and production ready?
Adoption signals are weak: roughly nine GitHub stars and zero dependents means essentially no production validation and no community troubleshooting corpus. It appears currently maintained based on a recent release, but a single-maintainer bundle with a narrow scope fits the classic abandonment profile. Check the composer.json constraints, the test suite and CI setup, and whether the maintainer responds to issues before depending on it.
How much effort is it to port the slug behavior to Blade and Alpine.js?
Budget a spike of half a day to two days, not a sprint. Clone the repository, read the form type and its front-end asset, and extract the exact interaction rules: trigger events, debounce timing, overwrite guard, empty-source handling, and disabled or readonly states. Then reimplement those rules in a Blade partial with Alpine.js or plain JavaScript, and write down in your ADR that the package was used as a design reference rather than a dependency.
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.
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core