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

[5.2] fix #13527 by setting the model on ModelNotFoundException #13537

Merged
merged 1 commit into from
May 12, 2016
Merged

[5.2] fix #13527 by setting the model on ModelNotFoundException #13537

merged 1 commit into from
May 12, 2016

Conversation

themsaid
Copy link
Member

Setting the model on ModelNotFoundException for firstOrFail in BelongsToMany and HasManyThrough relations.

@taylorotwell taylorotwell merged commit 07177e9 into laravel:5.2 May 12, 2016
$relation = $this->getMock('Illuminate\Database\Eloquent\Relations\BelongsToMany', ['find'], $this->getRelationArguments());
$relation->expects($this->once())->method('find')->with('foo')->will($this->returnValue(null));

$this->setExpectedException(\Illuminate\Database\Eloquent\ModelNotFoundException::class);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please avoid these leading slashes when we're not in a namespace.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, will do.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries. Thanks for all the great PRs. ;)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad to help mate :)

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.

3 participants