title: Group select options if description is the same
body: <p>So I have a select that the options are froma laravel Foreach</p>
  
  <pre><code>@foreach($courseMonth as $cm)-&gt;groupBy('description');
      &lt;optgroup label="{{ nameMonth($cm-&gt;month) }}"&gt;
          @foreach($days as $date)
              @if(date('m', strtotime($date['date'])) == $cm-&gt;month)
                  &lt;option value="{{ date('d/m/Y', strtotime($date['date'])) ." - ". $date['hours'] }}"&gt;{{ $date['description'] . ' - ' . date('d/m/Y', strtotime($date['date'])) . ' - ' . $date['hours'] . ' ('. $date['total'] . 'h)'}}&lt;/option&gt;
              @endif
          @endforeach
      &lt;/optgroup&gt;
      &lt;?php $i++;?&gt;
  @endforeach
  </code></pre>
  
  <p>This is the options. And I want if <code>$date['description']</code> is the same in two options, to combine both options. More detailed, if three options have their description as "Work", to combine all of the options.
  I've tried a groupby in front of the foreach</p>
  
  <pre><code>@foreach($courseMonth as $cm)-&gt;groupBy('description');
  </code></pre>
  
  <p>But this didn't do anything. The table for the options only has one row (ex: One row has only one description but it can have multiple day options in the select) so I need to group those only when there is the same description in two options.</p>
  
  <p>Table structure:</p>
  
  <pre><code>-----------------------------------------------
  | id | description | date     | hours | total |
  |---------------------------------------------|
  | 4  |    work     |2019-23-4 | 14h   | 6h    |
  | 5  |    work     |2019-23-5 | 13h   | 5h    |
  | 6  |    school   |2019-23-5 | 13h   | 5h    |
  -----------------------------------------------
  </code></pre>
  
  <p>So the first two would appear in the same option and the last one as the second option of the select.</p>