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

[5.7] Fix loadCount() attribute syncing #26714

merged 1 commit into from Dec 3, 2018


None yet
2 participants

staudenmeir commented Dec 3, 2018

loadCount() doesn't sync the new attributes with $original. This breaks UPDATE queries:

$user = User::all()->loadCount('posts')->first();
$user->foo = 'bar';
$user->save(); // "Unknown column 'posts_count'"

@taylorotwell taylorotwell merged commit 6a3dda7 into laravel:5.7 Dec 3, 2018

2 checks passed

continuous-integration/styleci/pr The analysis has passed
continuous-integration/travis-ci/pr The Travis CI build passed

@staudenmeir staudenmeir deleted the staudenmeir:load-count branch Dec 3, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment