{{ html()->label(__('Parent Category'))->for('parent_id') }} {{ html()->select('parent_id', parentCategories()??[]) // Pass an array of options ->value(old('parent_id', $asset_category?->parent_id)) // Preselect value ->class('form-control' . ($errors->has('parent_id') ? ' is-invalid' : '')) ->placeholder(__('Select Parent')) }} {!! $errors->first('parent_id', '') !!}
{{ html()->label(__('Name'))->for('name') }} {{ html()->text('name', old('name', $asset_category?->name)) ->class('form-control' . ($errors->has('name') ? ' is-invalid' : '')) ->placeholder(__('Name')) }} {!! $errors->first('name', '') !!}
{{ html()->label(__('Description'))->for('description') }} {{ html()->text('description', old('description', $asset_category?->description)) ->class('form-control' . ($errors->has('description') ? ' is-invalid' : '')) ->placeholder(__('Description')) }} {!! $errors->first('description', '') !!}
{{ html()->label(__('Is Active')) }} {{ html()->checkbox('is_active', old('is_active', $asset_category?->is_active), true) ->class('form-check-input custom-switch' . ($errors->has('is_active') ? ' is-invalid' : '')) ->id('is_active') }} {!! $errors->first('is_active', '') !!}
{{ html()->submit(__('Submit'))->class('btn btn-primary') }}