-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
Cannot delete custom MorphPivot in Laravel 6.18.26 #33647
Comments
Hey there, Can you first please try one of the support channels below? If you can actually identify this as a bug, feel free to report back and I'll gladly help you out and re-open this issue. Thanks! |
@driesvints Hey, I did a quick check in the source code of MorphMany and found the problem. This condition is missing in the delete method of MorphPivot in Laravel 6.x tag source code.
the same instruction exist in the simple Pivot model through the AsPivot trait: Can you please check it ? |
@driesvints i can confirm that it is the problem, i change the laravel source code of MorphPivot in my project (I know it is bad but I just wanted to check) And it works. |
@lukadriel7 feel free to attempt a pr to see if Taylor will merge it. |
@driesvints , about that I don't really know how to write tests... |
Description:
Trying to delete a custom MorphPivot Model using uuid as primary key result in an error:
Laravel uses an empty string instead of the id column to try and find the model.
Creating, updating and finding model by id still works.
Model Code:
Migration Code:
Steps To Reproduce:
The text was updated successfully, but these errors were encountered: