imJohnBon's avatar

[L5] BelongsToMany::hydratePivotRelation() error as of today?

All of a sudden I'm getting the following error all over my Laravel 5 application as of todays commits:

Argument 1 passed to Illuminate\Database\Eloquent\Relations\BelongsToMany::hydratePivotRelation() must be of the type array, object given

I'm about to dig into it, but just curious if anyone else already did and figured out what was wrong.

0 likes
3 replies
imJohnBon's avatar

Hmm, I may be wrong, but it looks like it may be related to this:

https://twitter.com/taylorotwell/status/553262692426059776

Query builder results return a collection, but several parts of the framework are still typehinted expecting an array. Hence the error. Just can't tell if this is something Taylor is still implementing or if I'm doing something wrong...

AnthonyC's avatar

Having the same issue...

It is because of the type hinting, I found the errors in BelongsToMany and also in Model class.

bestmomo's avatar

I made a comment on this commit and there is an issue related.

Just set this commit in composer meanwhile :

"laravel/framework": "dev-master#e33584db10fa3ca84bce135998a62e8c7529bff5",

Please or to participate in this conversation.