-
-
Notifications
You must be signed in to change notification settings - Fork 458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slugging does not occur If the sluggable field and the source are the same #270
Comments
Nor should it, I would think. How would that work? |
I have a form field for the slug. In my case the slug is not derived from another field but the value of the slug field it self in the form is the one being slugged. In my project i have a pages module where the user will specify the uri of the page using the slug field. The user can say something like "contact us" and it should be transformed to "contact-us" I think you shouldn't make such restrictions and let the user choose decide freely what is the source field. |
I get what you're trying to do. But then I don't think this package is what you need. My idea was to make it easy to automatically generate slugs based on other fields in the model (e.g. generate the URI from the page's title field, etc.). What you are discussing is having users manually specify the field ... in which case you can get away with Laravel's built in validation rules to ensure uniqueness, and built in functions like If you can submit a PR that allows the source field for a slug to be the same as the destination field, and some related tests, I'd be happy to consider it. But I do feel that what you are asking is outside the scope of this package. |
@cviebrock My table, model have a field called "slug". I am actually saving the slug into the database. The only difference in my case, is that i'm using the same field for the source and destination instead of using the title field. By the way i'm using you package in my articles module where i have the title as the source for the slug. |
Would be useful for me too. The main use for me is the checking existing slugs and generating unique ones. In my case I don't actually want to store the source string at all. |
Hi,
Slugging does not occur If the sluggable field and the source are the same
The text was updated successfully, but these errors were encountered: