@@ -148,7 +157,7 @@
@endif
- @if ($asset->model->manufacturer)
+ @if (($asset->model) && ($asset->model->manufacturer))
{{ trans('admin/hardware/form.manufacturer') }} |
@@ -162,21 +171,21 @@
{{ $asset->model->manufacturer->name }}
@endcan
- @if ($asset->model->manufacturer->url)
+ @if (($asset->model) && ($asset->model->manufacturer->url))
{{ $asset->model->manufacturer->url }}
@endif
- @if ($asset->model->manufacturer->support_url)
+ @if (($asset->model) && ($asset->model->manufacturer->support_url))
{{ $asset->model->manufacturer->support_url }}
@endif
- @if ($asset->model->manufacturer->support_phone)
+ @if (($asset->model) && ($asset->model->manufacturer->support_phone))
{{ $asset->model->manufacturer->support_phone }}
@endif
- @if ($asset->model->manufacturer->support_email)
+ @if (($asset->model) && ($asset->model->manufacturer->support_email))
{{ $asset->model->manufacturer->support_email }}
@endif
@@ -188,7 +197,7 @@
|
{{ trans('general.category') }} |
- @if ($asset->model->category)
+ @if (($asset->model) && ($asset->model->category))
@can('view', \App\Models\Category::class)
@@ -208,15 +217,21 @@
|
- {{ trans('admin/hardware/form.model') }} |
+ {{ trans('admin/hardware/form.model') }}
+
- @can('view', \App\Models\AssetModel::class)
-
- {{ $asset->model->name }}
-
- @else
- {{ $asset->model->name }}
- @endcan
+
+ @if ($asset->model)
+
+ @can('view', \App\Models\AssetModel::class)
+
+ {{ $asset->model->name }}
+
+ @else
+ {{ $asset->model->name }}
+ @endcan
+
+ @endif
|
@@ -224,12 +239,12 @@
{{ trans('admin/models/table.modelnumber') }} |
- {{ $asset->model->model_number }}
+ {{ ($asset->model) ? $asset->model->model_number : ''}}
|
- @if ($asset->model->fieldset)
+ @if (($asset->model) && ($asset->model->fieldset))
@foreach($asset->model->fieldset->fields as $field)
@@ -326,7 +341,7 @@
|
@endif
- @if ($asset->depreciation)
+ @if (($asset->model) && ($asset->depreciation))
{{ trans('general.depreciation') }} |
@@ -352,7 +367,7 @@
|
@endif
- @if ($asset->model->eol)
+ @if (($asset->model) && ($asset->model->eol))
{{ trans('admin/hardware/form.eol_rate') }} |
@@ -448,7 +463,7 @@
@if ($asset->image)
- @elseif ($asset->model->image!='')
+ @elseif (($asset->model) && ($asset->model->image!=''))
@endif
|