Look at Eager Load Constraints on the http://laravel.com/docs/eloquent#eager-loading for the proper way to run this query. Let me know if it's still not working after that.
I am familiar with the documentation but do not see what it is that I am doing wrong that causes the framework to exclude the table qualifier in the "set" portion of the update while including the table qualifier in the "where" portion.
Is there a way I can force the "set" portion to pre-pend with the proper table?
Yes, this is a bug. These columns should be prefixed with table name. There is no way to achieve that with hasManyThrough
(and belongsToMany
with timestamps on pivot table), even with manual update, because Eloquent will automatically add updated_at = xxxx
part, which will cause the error anyway.
Please post it as an issue to the Laravel repo.
Of course you can still build the whole query manually instead of using $model->relation()
and you can achieve that, but it should work just like you tried.
I poked around on GitHub but could not see where to post an issue.
But, yes, I will just use DB::table for this.
Thank you.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community