custom fields display, need to get saving

+some clean up
This commit is contained in:
slong753 2023-03-28 21:45:31 -05:00
parent 804a788a27
commit 032ae4348e
2 changed files with 17 additions and 5 deletions

View file

@ -47,6 +47,10 @@ class BulkAssetsController extends Controller
$asset_custom_field = Asset::whereIn('id', $asset_ids)->whereHas('model', function ($query) {
return $query->where('fieldset_id', '!=', null);
})->get();
$models1 = $asset_custom_field->unique('model_id');
$models = $models1->pluck('model');
$custom_fields = new Collection();
foreach ($asset_custom_field as $asset_key => $asset) {
$custom_fields->push($asset->model->fieldset->fields);
@ -72,7 +76,8 @@ class BulkAssetsController extends Controller
return view('hardware/bulk')
->with('assets', $asset_ids)
->with('statuslabel_list', Helper::statusLabelList())
->with('custom_fields', $custom_fields);
->with('custom_fields', $custom_fields)
->with('models', $models);
}
}

View file

@ -183,13 +183,20 @@
</div>
</div>
@foreach ($custom_fields as $key => $value)
<p>
{{-- @foreach ($custom_fields as $key => $value)
<p>
<label>
({{ $value->id }}) | {{ $value->name}} - {{ $value->format }}
</label>
</p>
@endforeach
</p>
@endforeach --}}
@foreach ($models as $model)
<label>
{{ $model->name }} asset model
</label>
@include("models/custom_fields_form",["model" => $model])
@endforeach