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
Sluggable For Laravel

Sluggable For Laravel Laravel Package

roundly-consulting/sluggable-for-laravel

A Laravel package for adding automatic, customizable slug generation to Eloquent models. Create unique, SEO-friendly URLs from titles or other attributes with configurable source fields, uniqueness handling, and simple model integration.

View on GitHub
Deep Wiki
Context7

Single- and multi-language (json/jsonb locale-map) slugs for Eloquent: multiple columns per model, scoped per-locale uniqueness with engine-native indexes, locale-aware route binding, SEO slug history — native, zero third-party deps.

Frequently asked questions about Sluggable For Laravel
How do I install roundly-consulting/sluggable-for-laravel in a Laravel app?
Install it through Composer using the package name roundly-consulting/sluggable-for-laravel, then apply the package configuration for your Laravel app. Because it is a Laravel package, confirm service provider or package discovery behavior for your framework version. After installation, run your existing test suite and verify slug generation on a model in a non-production environment.
How does automatic slug generation work on Eloquent models?
The package generates URL-friendly slugs automatically from a model attribute on create and update. You define the slug source column once, and the package produces clean values suitable for readable permalinks. It is designed for Eloquent models, so the generated slug stays attached to normal model persistence.
Can I customize the source field and separator for slugs?
Yes. The package provides framework-native configuration for the slug source field, separator, and uniqueness behavior. You can point slugs at a title or any other suitable model attribute and choose the separator you want. Keep the source field consistent so existing URLs remain stable.
How are duplicate slugs handled by this package?
Unique slug enforcement is built in, with configurable suffixes used when a generated slug already exists. That lets multiple records with similar titles receive distinct URL-friendly values. You should still test edge cases such as updates and records with very similar source values.
Does it work with Laravel route model binding?
Yes. The package is described as working with Eloquent models and route model binding. That means a model with a generated slug can be resolved through normal Laravel route model binding. Confirm the binding key and route parameter names match your application setup.
Which Laravel and PHP versions are supported by sluggable-for-laravel?
The provided context does not list exact Laravel or PHP version constraints, so check the package's composer.json and README before installing. Validate the package against your application's Laravel and PHP versions, especially if you maintain older branches. Version 1.1.3 is a patch release, but framework drift in factory internals is still worth testing.
Is version 1.1.3 a safe patch upgrade for existing Laravel apps?
The assessment treats 1.1.3 as a patch upgrade with no obvious schema or API migration requirement. Pin 1.1.3 in Composer, run your test suite, and promote it through CI before broad branch adoption. If your app swaps configured models in tests, add a targeted regression test for that path.
What does version 1.1.3 fix for Laravel factories and swapped models?
The 1.1.3 fix indicates the package participates in Laravel factory generation and supports host applications that swap the configured model. It improves correctness when your test or host app changes the model class, reducing false positives or false negatives in package integration tests. Verify custom factory classes, relationships, and table resolution after a model swap.
How should I test model swapping and avoid production issues with this package?
Add a focused test that swaps the configured model, builds it through the factory, and asserts the swapped model is returned. Also check relationship and table resolution, and clear stale config cache in environments where configuration is cached. Run that test in CI so factory or Laravel-version changes do not silently break model swapping.
When should I use this package instead of manually generating slugs with Str::slug, and what maintenance should I expect?
Use this package when you want automatic, unique slugs on Eloquent create and update without hand-writing Str::slug calls and uniqueness checks in every model. Manual generation can be enough for a one-off field, but the package centralizes source-field, separator, and suffix configuration. For maintenance, confirm issue-tracker activity, release cadence, and SemVer discipline before making it part of your stack.
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.
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo
bernskioldmedia/laravel-harvest
bernskiold/laravel-data-scrubber
bernskiold/laravel-currency-converter
bernskiold/laravel-campaign-monitor
bernskioldmedia/laravel-autotranslate
siberfx/telegram-bot
roy-sandip/laravel-view-extended
gregsphotography/site-builder-core
roy-sandip/laravel-view
anodyne/blade-fluentui-icons
webx-ui/module-catalog-collections