Skip to content

Commit 866f0a9

Browse files
committed
syncs assets location to users location
1 parent 05a8d30 commit 866f0a9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/Console/Commands/LdapSync.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,9 +391,11 @@ public function handle()
391391
$user->location_id = $location->id;
392392
}
393393
}
394-
$assets = Asset::whereColumn('assigned_to', '=', $user->id)->get();
394+
//updates assets location based on user's location
395+
$assets = Asset::where('assigned_to', '=', $user->id)->get();
395396
foreach($assets as $asset){
396397
$asset->location_id = $user->location_id;
398+
$asset->save();
397399
}
398400

399401
$user->ldap_import = 1;

0 commit comments

Comments
 (0)