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

[8.x] Fix undefined property with sole query #36216

Merged
merged 2 commits into from
Feb 10, 2021

Conversation

mmachatschek
Copy link
Contributor

This is a followup to PR #36200 if no model exists on a e.g. BelongsToMany relation the ::$model property doesn't exist.

The findOrFail() method on the BelongsToMany::class also uses the ::$related property to set the model on the ModelNotFoundException https://github.com/laravel/framework/blob/8.x/src/Illuminate/Database/Eloquent/Relations/BelongsToMany.php#L702

@mmachatschek mmachatschek changed the title Fix undefined property with sole query [8.x] Fix undefined property with sole query Feb 10, 2021
@taylorotwell taylorotwell merged commit 1e0549a into laravel:8.x Feb 10, 2021
@mmachatschek mmachatschek deleted the fix_sole_relation_exception branch February 10, 2021 14:25
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.

2 participants