{{-- If we're back on this screen for an error, *and* we are doing 'create multiple', then... --}}
@php
$old_tags = old('asset_tags',[]);
/**
okay, so old() comes back as:
(
[1] => 1744410541
[2] => 1744410542
)
*/
if(array_key_exists('1',$old_tags)) {
unset($old_tags[1]); //we already handled 'asset_tag.1' - so unset it
}
@endphp
@foreach(array_keys($old_tags) as $i)
{{-- This is mostly stolen from the HTML that we add via javascript on the 'add_field_button' handler in the embedded JS below --}}
{{-- @include ('partials.forms.edit.serial', ['fieldname'=> 'serials['.$loop->iteration.']', 'old_val_name' => 'serials.'.$loop->iteration, 'translated_serial' => trans('admin/hardware/form.serial')])--}}
@if ($item->model && $item->model->fieldset)
Warning: Undefined variable $item in C:\xampp\htdocs\snipe-it\resources\views\hardware\edit.blade.php on line 120
Warning: Attempt to read property "model" on null in C:\xampp\htdocs\snipe-it\resources\views\hardware\edit.blade.php on line 120
@endif
@if (old('model_id'))
@php
$model = \App\Models\AssetModel::find(old('model_id'));
@endphp
@elseif (isset($selected_model))
@php
$model = $selected_model;
@endphp
@endif
@if (isset($model) && $model)
@include("models/custom_fields_form",["model" => $model])
@endif