mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
parent
7225b53986
commit
3fbfb0c658
|
@ -30,7 +30,7 @@ class AssetModelsController extends Controller
|
||||||
public function index(Request $request)
|
public function index(Request $request)
|
||||||
{
|
{
|
||||||
$this->authorize('view', AssetModel::class);
|
$this->authorize('view', AssetModel::class);
|
||||||
$allowed_columns = ['id','image','name','model_number','eol','notes','created_at','manufacturer','assets_count'];
|
$allowed_columns = ['id','image','name','model_number','eol','notes','created_at','manufacturer','requestable', 'assets_count'];
|
||||||
|
|
||||||
$assetmodels = AssetModel::select([
|
$assetmodels = AssetModel::select([
|
||||||
'models.id',
|
'models.id',
|
||||||
|
@ -38,6 +38,7 @@ class AssetModelsController extends Controller
|
||||||
'models.name',
|
'models.name',
|
||||||
'model_number',
|
'model_number',
|
||||||
'eol',
|
'eol',
|
||||||
|
'requestable',
|
||||||
'models.notes',
|
'models.notes',
|
||||||
'models.created_at',
|
'models.created_at',
|
||||||
'category_id',
|
'category_id',
|
||||||
|
|
|
@ -45,6 +45,7 @@ class AssetModelsTransformer
|
||||||
'name'=> e($assetmodel->fieldset->name)
|
'name'=> e($assetmodel->fieldset->name)
|
||||||
] : null,
|
] : null,
|
||||||
'eol' => ($assetmodel->eol > 0) ? $assetmodel->eol .' months': 'None',
|
'eol' => ($assetmodel->eol > 0) ? $assetmodel->eol .' months': 'None',
|
||||||
|
'requestable' => ($assetmodel->requestable =='1') ? true : false,
|
||||||
'notes' => e($assetmodel->notes),
|
'notes' => e($assetmodel->notes),
|
||||||
'created_at' => Helper::getFormattedDateObject($assetmodel->created_at, 'datetime'),
|
'created_at' => Helper::getFormattedDateObject($assetmodel->created_at, 'datetime'),
|
||||||
'updated_at' => Helper::getFormattedDateObject($assetmodel->updated_at, 'datetime'),
|
'updated_at' => Helper::getFormattedDateObject($assetmodel->updated_at, 'datetime'),
|
||||||
|
|
Loading…
Reference in a new issue