mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-13 17:14:10 -08:00
No idea why this is needed, but…
This commit is contained in:
parent
733921f1f9
commit
53a1511cac
|
@ -31,7 +31,7 @@ class MigrateDenormedAssetLocations extends Migration
|
||||||
$assigned_user_assets = Asset::where('assigned_type',User::class)->whereNotNull('assigned_to')->get();
|
$assigned_user_assets = Asset::where('assigned_type',User::class)->whereNotNull('assigned_to')->get();
|
||||||
\Log::debug('User-assigned assets:');
|
\Log::debug('User-assigned assets:');
|
||||||
foreach ($assigned_user_assets as $assigned_user_asset) {
|
foreach ($assigned_user_assets as $assigned_user_asset) {
|
||||||
if ($assigned_user_asset->assignedTo->userLoc) {
|
if (($assigned_user_asset->assignedTo) && ($assigned_user_asset->assignedTo->userLoc)) {
|
||||||
$new_location=$assigned_user_asset->assignedTo->userloc->id;
|
$new_location=$assigned_user_asset->assignedTo->userloc->id;
|
||||||
\Log::info(' They are in '.$assigned_user_asset->assignedTo->userloc->name.' which is id: '.$new_location);
|
\Log::info(' They are in '.$assigned_user_asset->assignedTo->userloc->name.' which is id: '.$new_location);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue