From 29b0780c6cdb3beb2a4b61f4b50a29fcba4a1220 Mon Sep 17 00:00:00 2001 From: snipe Date: Tue, 30 Oct 2018 00:20:16 -0700 Subject: [PATCH] Added company info to asset maintenances transforrmer --- app/Http/Transformers/AssetMaintenancesTransformer.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Http/Transformers/AssetMaintenancesTransformer.php b/app/Http/Transformers/AssetMaintenancesTransformer.php index df2e751ea2..de7ec86901 100644 --- a/app/Http/Transformers/AssetMaintenancesTransformer.php +++ b/app/Http/Transformers/AssetMaintenancesTransformer.php @@ -27,6 +27,11 @@ class AssetMaintenancesTransformer 'name'=> ($assetmaintenance->asset->name) ? e($assetmaintenance->asset->name) : null, 'asset_tag'=> e($assetmaintenance->asset->asset_tag) + ] : null, + 'company' => (($assetmaintenance->asset->company) && ($assetmaintenance->asset)) ? [ + 'id' => (int) $assetmaintenance->asset->company->id, + 'name'=> ($assetmaintenance->asset->company->name) ? e($assetmaintenance->asset->company->name) : null, + ] : null, 'title' => ($assetmaintenance->title) ? e($assetmaintenance->title) : null, 'location' => (($assetmaintenance->asset) && ($assetmaintenance->asset->location)) ? [