-
-
Notifications
You must be signed in to change notification settings - Fork 463
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
Uniqueness using the replicate method #20
Comments
I think the issue is that // skip slug generation if the model exists or the slug field is already populated,
// and on_update is false ... unless we are forcing things!
if ( !$force )
{
if ( ( $model->exists || !empty($model->{$save_to}) ) && !$on_update )
{
return true;
}
} Unless the $new_model = $old_model->replicate();
Sluggable::make($new_model,true); |
On further inspection, I need to add another check when forcing the slugging to make this work. Fix is coming soon ... (although you will still need to manually run |
Fixed in 1.0.8. |
Awesome, thanks |
When a record is copied using the Eloquent replicate method the slug is not updated to be unique. The replicate method should check for uniqueness when saving the record.
The text was updated successfully, but these errors were encountered: