syncs assets location to users location

This commit is contained in:
Godfrey M 2024-03-19 11:58:49 -07:00
parent 05a8d3030b
commit 866f0a9f56

View file

@ -391,9 +391,11 @@ class LdapSync extends Command
$user->location_id = $location->id;
}
}
$assets = Asset::whereColumn('assigned_to', '=', $user->id)->get();
//updates assets location based on user's location
$assets = Asset::where('assigned_to', '=', $user->id)->get();
foreach($assets as $asset){
$asset->location_id = $user->location_id;
$asset->save();
}
$user->ldap_import = 1;