Support the ongoing development of Laravel.io →
Database Eloquent
Last updated 1 year ago.
0

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.

Last updated 1 year ago.
0

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.

Last updated 1 year ago.
0

Is there a way I can force the "set" portion to pre-pend with the proper table?

Last updated 1 year ago.
0

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.

Last updated 1 year ago.
0

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.

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

neon5 neon5 Joined 21 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.