title: remove an index from array if a variable does not have value laravel php
body: <p>i have an array like below :</p>
  <pre><code> $attributeOptionsData[] = [
                      'id'           =&gt; $optionId,
                      'label'        =&gt; $attributeOption-&gt;label ? $attributeOption-&gt;label : $attributeOption-&gt;admin_name,
                      'swatch_value' =&gt; $attribute-&gt;swatch_type == 'image' ? $attributeOption-&gt;swatch_value_url : $attributeOption-&gt;swatch_value,
                      'products'     =&gt; $options[$attribute-&gt;id][$optionId],
                      'images'     =&gt; $productImage ?? null,
                  ];
  </code></pre>
  <p>i simply want to instead of null safe the <code>images</code> if the <code>$productImage</code> does not have value remove it from the array i mean remove <code>images</code> completely is that possible ??</p>