Skip to content
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

[9.x] Remove parameter from DecoratesQueryBuilder::delete() #39900

Merged
merged 1 commit into from
Dec 6, 2021
Merged

[9.x] Remove parameter from DecoratesQueryBuilder::delete() #39900

merged 1 commit into from
Dec 6, 2021

Conversation

staudenmeir
Copy link
Contributor

#37956 added the DecoratesQueryBuilder trait to improve type hinting. delete() is a special case as its method signature in Eloquent\Builder is different from Query\Builder. Only the base query builder has an $id parameter, the Eloquent one doesn't:

public function delete()

public function delete($id = null)

The trait is used in relationship classes and so the IDE suggests that $user->posts()->delete(1) works, but the parameter is actually ignored because Eloquent\Builder::delete() doesn't pass it on to Query\Builder::delete().

@taylorotwell taylorotwell merged commit eb66b96 into laravel:master Dec 6, 2021
@staudenmeir staudenmeir deleted the delete branch December 6, 2021 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants