diff --git a/app/Http/Controllers/Api/AssetsController.php b/app/Http/Controllers/Api/AssetsController.php index 7482c03f17..d9e9a2190f 100644 --- a/app/Http/Controllers/Api/AssetsController.php +++ b/app/Http/Controllers/Api/AssetsController.php @@ -111,6 +111,7 @@ class AssetsController extends Controller 'requests_counter', 'byod', 'asset_eol_date', + 'requestable', ]; $filter = []; diff --git a/app/Http/Transformers/AssetsTransformer.php b/app/Http/Transformers/AssetsTransformer.php index f5d5ae12b5..b9191d2e63 100644 --- a/app/Http/Transformers/AssetsTransformer.php +++ b/app/Http/Transformers/AssetsTransformer.php @@ -37,6 +37,7 @@ class AssetsTransformer 'name'=> e($asset->model->name), ] : null, 'byod' => ($asset->byod ? true : false), + 'requestable' => ($asset->requestable ? true : false), 'model_number' => (($asset->model) && ($asset->model->model_number)) ? e($asset->model->model_number) : null, 'eol' => (($asset->asset_eol_date != '') && ($asset->purchase_date != '')) ? Carbon::parse($asset->asset_eol_date)->diffInMonths($asset->purchase_date).' months' : null, diff --git a/app/Presenters/AssetPresenter.php b/app/Presenters/AssetPresenter.php index de7c2c7709..dd88b07fde 100644 --- a/app/Presenters/AssetPresenter.php +++ b/app/Presenters/AssetPresenter.php @@ -195,6 +195,14 @@ class AssetPresenter extends Presenter 'visible' => false, 'title' => trans('admin/hardware/form.warranty_expires'), 'formatter' => 'dateDisplayFormatter', + ], [ + 'field' => 'requestable', + 'searchable' => false, + 'sortable' => true, + 'visible' => false, + 'title' => trans('admin/hardware/general.requestable'), + 'formatter' => 'trueFalseFormatter', + ], [ 'field' => 'notes', 'searchable' => true,