Fix performance issue in loadbalancers module (#11771)

* Update Component.php

* wrong quotes

Co-authored-by: Tony Murray <murraytony@gmail.com>
This commit is contained in:
tamirhad 2020-06-05 04:36:43 +03:00 committed by GitHub
parent 2a5b1fd071
commit e26498ad91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -219,10 +219,11 @@ class Component
->with('prefs')
->get()
->each(function (\App\Models\Component $component) use ($updated) {
unset($updated[$component->id]['type']); // can't change type
$update = $updated[$component->id];
unset($update['type']); // can't change type
// update component attributes
$component->fill($updated[$component->id]);
$component->fill($update);
if ($component->isDirty()) {
// Log the update to the Eventlog.
$message = "Component $component->id has been modified: ";