diff --git a/app/Http/Transformers/AssetsTransformer.php b/app/Http/Transformers/AssetsTransformer.php index 92ba702a15..1b53d61aa8 100644 --- a/app/Http/Transformers/AssetsTransformer.php +++ b/app/Http/Transformers/AssetsTransformer.php @@ -54,9 +54,9 @@ class AssetsTransformer 'id' => (int) $asset->company->id, 'name'=> e($asset->company->name) ] : null, - 'location' => ($asset->assetLoc) ? [ - 'id' => (int) $asset->assetLoc->id, - 'name'=> e($asset->assetLoc->name) + 'location' => ($asset->assetloc) ? [ + 'id' => (int) $asset->assetloc->id, + 'name'=> e($asset->assetloc->name) ] : null, 'rtd_location' => ($asset->defaultLoc) ? [ 'id' => (int) $asset->defaultLoc->id,