-
Notifications
You must be signed in to change notification settings - Fork 23
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
Generate Button #9
Comments
@cgarofalo Only if I understood it correctly. You could distinguish update and create with the given Slug::make(...)->readOnly($request->isUpdateOrUpdateAttachedRequest() ? true : false) This will prevent the slug from being changed in edit mode and the slug being changable in any other mode. |
@cgarofalo Ah sorry, this behaviour isn't cross-browser. I create a new issue and PR if the author is ok with an added feature. |
That would make the package much more usable. Slug are often in URL segments and these shouldn't accidentally change - for a number of reasons (SEO, bookmarks, etc.). Do you think you could look at this @drobee ? |
As a workaround to prevent changes on update, you could do it like so: SluggableText::make()
->slug($request->isUpdateOrUpdateAttachedRequest() ? 'DONOTUPDATE' : 'Slug'); It checks if its an update request and if yes, it tries to update the not existing 'DONOTUPDATE' field. Otherwise (on create) it uses the correct field label This is dirty, I know, but it works until @drobee fixes this issue. |
That's a good idea. Thanks for the suggestion @bernhardh |
Hi there,
Would it be possible to add an option where the slug is generated by clicking a button instead of keyup and blur? I'd only like to generate the slug if it's required. As is, the slug will change when the title field is updated. I don't really want the slug automatically change if I'm editing vs. creating.
Thanks!
The text was updated successfully, but these errors were encountered: