Skip to content

Fix #1157 (Model::has() - ErrorException: Array to string conversion) #1158

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

Merged
merged 1 commit into from
Mar 20, 2017

Conversation

benargo
Copy link
Contributor

@benargo benargo commented Mar 18, 2017

Fix #1157

With ‘BelongsToMany’ relationships calling the function Jenssegers\Mongodb\Eloquent\Model::has can throw an ErrorException with ‘Array to string conversion’.

By flattening the collection here we can avoid triggering the exception.

With ‘BelongsToMany’ relationships calling the function `Jenssegers\Mongodb\Eloquent\Model::has` can throw an ErrorException with ‘Array to string conversion’.

By flattening the collection here we can avoid triggering the exception.
@jenssegers jenssegers merged commit 3276bac into mongodb:master Mar 20, 2017
@benargo benargo deleted the haswhere branch June 4, 2017 11:16
mnphpexpert added a commit to mnphpexpert/laravel-mongodb that referenced this pull request Sep 2, 2024
Fix mongodb#1157 (Model::has() - ErrorException: Array to string conversion)
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