-
Notifications
You must be signed in to change notification settings - Fork 11.1k
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
More than one chained withPivot returns NULL while acessing a column from pivot table #33
Comments
Looking at the source it looks like the listed columns are overwritten with each call to |
Actually I don't need it, I just converted my L3 query to L4 and they were chained in L3, wich made me suppose that it should work chained in L4 too, but I don't really see a case when I would need it to be chained. :) |
We'll see what @taylorotwell thinks about it. It's quite an easy thing to patch though. But yeah, generally you'd only have one call to it. |
Yeah, just stick with one call. |
Add missing class import
Not really important, but I'm not sure if it is supposed to work or not but this is not working:
$this->belongsToMany('Country')->withPivot('regional_name')->withPivot('enabled');
But this is working fine:
$this->belongsToMany('Country')->withPivot('regional_name', 'enabled');
When i do:
$model->pivot->regional_name;
The text was updated successfully, but these errors were encountered: