We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 6bec573 + c62a022 commit 787340bCopy full SHA for 787340b
app/Console/Commands/LdapSync.php
@@ -2,6 +2,7 @@
2
3
namespace App\Console\Commands;
4
5
+use App\Models\Asset;
6
use App\Models\Department;
7
use App\Models\Group;
8
use Illuminate\Console\Command;
@@ -418,6 +419,8 @@ public function handle()
418
419
if ($item['createorupdate'] === 'created' && $ldap_default_group) {
420
$user->groups()->attach($ldap_default_group);
421
}
422
+ //updates assets location based on user's location
423
+ Asset::where('assigned_to', '=', $user->id)->update(['location_id' => $user->location_id]);
424
425
} else {
426
foreach ($user->getErrors()->getMessages() as $key => $err) {
0 commit comments