title: Laravel - select2 | reset select values upon form reset
body: <p>I have an update form and I am using select2 and blade to fill in previous records in select2:</p>
  
  <pre><code>&lt;div class="col-7 m-input--solid"&gt;
      &lt;select class="form-control m-select2 m-input--solid" id="m_select2_3" name="collegeCourses[]" multiple&gt;
          //for each of course categories
          @foreach($courseCategories as $courseCategory)
          //set optlabel
          &lt;optgroup label="{{$courseCategory}}"&gt;
              //for each of courses in a courseCategory
              @foreach($courseNames-&gt;$courseCategory as $courseName)
              // set value and text and conditionally set "selected" attribute if the college already has those courses.
              &lt;option value="{{$courseName}}" {{((in_array($courseName, $college-&gt;courses())) ? 'selected="selected"' : '')}}&gt;
                  {{$courseName}}
              &lt;/option&gt;
              @endforeach
          &lt;/optgroup&gt;
          @endforeach
      &lt;/select&gt;
  &lt;/div&gt;
  
  &lt;button type="Submit" class="btn btn-accent m-btn m-btn--air m-btn--custom"&gt;
  Save changes
  &lt;/button&gt;
  &amp;nbsp;&amp;nbsp;
  &lt;button type="reset" class="btn btn-secondary m-btn m-btn--air m-btn--custom"&gt;
  Cancel
  &lt;/button&gt;
  </code></pre>
  
  <p>I observe that clicking reset does not reselt the select2 values to the default "selected" values.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>This is an update form for an already existing record, I am setting the original ( which are stored with record) as selected by default. I want to be able to set these selected option to be restored upon clicking reset.</p>
  
  <p><em>what is going wrong here?</em></p>