title: how to make selected option using enum in laravel?
body: <p>this is my code, how to make the selected option value in the edit form using enum data in the database? this is not working it just view the select option, not with id-data</p>
  <p>this the code blade</p>
  <pre><code> &lt;!-- Modal  edit --&gt;
       @foreach($daftar_pelanggan as $pelanggan)
       &lt;div class=&quot;modal fade&quot; id=&quot;editModal-{{ $pelanggan-&gt;id }}&quot; tabindex=&quot;-1&quot; role=&quot;dialog&quot; aria-labelledby=&quot;editModalLabel&quot; aria-hidden=&quot;true&quot;&gt;
         &lt;div class=&quot;modal-dialog modal-dialog-centered&quot; role=&quot;document&quot;&gt;
            &lt;div class=&quot;modal-content&quot;&gt;
                  &lt;div class=&quot;modal-header&quot;&gt;
                    &lt;h5 class=&quot;modal-title mb-0&quot; id=&quot;editModalLabel&quot;&gt;Update Data Pelanggan&lt;/h5&gt;
                  &lt;/div&gt;
                &lt;div class=&quot;modal-body&quot;&gt;
                   &lt;!-- Card body --&gt;
                  &lt;form role=&quot;form&quot; action=&quot;{{ route('daftar_pelanggan.update') }}&quot; method=&quot;POST&quot; id=&quot;editForm&quot;&gt;
                    @csrf
                    @method('PUT')
                      &lt;!-- Input groups with icon --&gt;
                    &lt;div class=&quot;form-group row&quot;&gt;
                        &lt;label for=&quot;updateNamaPelanggan&quot; class=&quot;col-md-2 col-form-label form-control-label&quot;&gt;Nama&lt;/label&gt;
                        &lt;div class=&quot;col-md-10&quot;&gt;
                        &lt;input type=&quot;hidden&quot; name=&quot;id&quot;  value=&quot;{{ $pelanggan-&gt;id }}&quot;&gt;
                          &lt;input class=&quot;form-control&quot; type=&quot;nama&quot;  value=&quot;{{ $pelanggan-&gt;nama_pelanggan }}&quot; id=&quot;updateNamaPelanggan&quot; name=&quot;updateNamaPelanggan&quot; required &gt;
                        &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class=&quot;form-group row&quot;&gt;
                        &lt;label for=&quot;updateAlamat&quot; class=&quot;col-md-2 col-form-label form-control-label&quot;&gt;Alamat&lt;/label&gt;
                        &lt;div class=&quot;col-md-10&quot;&gt;
                          &lt;input class=&quot;form-control&quot; type=&quot;alamat&quot; value=&quot;{{ $pelanggan-&gt;alamat }}&quot;  id=&quot;updateAlamat&quot; name=&quot;updateAlamat&quot; required&gt;
                        &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class=&quot;form-group row&quot;&gt;
                        &lt;label for=&quot;updateNoTelp&quot; class=&quot;col-md-2 col-form-label form-control-label&quot;&gt;No.Telp&lt;/label&gt;
                        &lt;div class=&quot;col-md-10&quot;&gt;
                          &lt;input class=&quot;form-control&quot; type=&quot;notelp&quot; value=&quot;{{ $pelanggan-&gt;no_telp }}&quot;  id=&quot;updateNoTelp&quot; name=&quot;updateNoTelp&quot; required&gt;
                        &lt;/div&gt;
                      &lt;/div&gt;
                      &lt;div class=&quot;form-group row&quot;&gt;
                        &lt;div class=&quot;col-md-6&quot;&gt;
                          &lt;div class=&quot;form-group&quot;&gt;
                            &lt;label class=&quot;form-control-label&quot; for=&quot;updatePoin&quot;&gt;POIN&lt;/label&gt;
                            &lt;input type=&quot;text&quot; class=&quot;form-control&quot; value=&quot;{{ $pelanggan-&gt;poin }}&quot;  id=&quot;updatePoin&quot;  name=&quot;updatePoin&quot;&gt;
                          &lt;/div&gt;
                        &lt;/div&gt;
                        &lt;div class=&quot;col-md-6&quot;&gt;
                          &lt;div class=&quot;form-group&quot;&gt;
                            &lt;label class=&quot;form-control-label&quot; for=&quot;status_member&quot;&gt;Kategori&lt;/label&gt;
                              &lt;select class=&quot;form-control&quot; id=&quot;status_member&quot; name=&quot;status_member&quot; required=&quot;required&quot;&gt;
                              &lt;option value=&quot;&quot; disabled selected&gt;- Pilih -&lt;/option                              &lt;option value=&quot;silver&quot;{{($pelanggan-&gt;status_member === 'silver') ? 'selected' : '' }} &gt;Silver&lt;/option&gt;
                                &lt;option value=&quot;gold&quot; {{ ($pelanggan-&gt;status_member === 'gold'? 'selected' : '')}}&gt;Gold&lt;/option&gt;
                                &lt;option value=&quot;diamond&quot; {{($pelanggan-&gt;status_member === 'diamond')? 'selected' : ''}}&gt;Diamond&lt;/option&gt;
                              &lt;/select&gt;    
                          &lt;/div&gt;
                        &lt;/div&gt;
                      &lt;/div&gt;   
              &lt;/div&gt;
              &lt;div class=&quot;modal-footer&quot;&gt;
                &lt;button type=&quot;reset&quot; class=&quot;btn btn-secondary&quot; data-dismiss=&quot;modal&quot;&gt;Reset&lt;/button&gt;
                &lt;button type=&quot;submit&quot; class=&quot;btn btn-primary&quot;&gt;Update Data&lt;/button&gt;
              &lt;/div&gt;
              &lt;/form&gt;
           &lt;/div&gt;
         &lt;/div&gt;
      &lt;/div&gt;
      @endforeach
  </code></pre>
  <p>this is select code this is not working what's wrong with this code?</p>
  <pre><code> &lt;option value=&quot;&quot; disabled selected&gt;- Pilih -&lt;/option                              &lt;option value=&quot;silver&quot;{{($pelanggan-&gt;status_member === 'silver') ? 'selected' : '' }} &gt;Silver&lt;/option&gt;
                                &lt;option value=&quot;gold&quot; {{ ($pelanggan-&gt;status_member === 'gold'? 'selected' : '')}}&gt;Gold&lt;/option&gt;
                                &lt;option value=&quot;diamond&quot; {{($pelanggan-&gt;status_member === 'diamond')? 'selected' : ''}}&gt;Diamond&lt;/option&gt;
                              &lt;/select&gt;
  </code></pre>
  <p>and i edit with this still not working what's wrong with this code?</p>
  <pre><code>&lt;select class=&quot;form-control&quot; id=&quot;status_member-&quot; name=&quot;status_member&quot; required=&quot;required&quot;&gt;
                                      @if($pelanggan-&gt;status_member == &quot;silver&quot;)
                                          &lt;option value=&quot;silver&quot; selected=&quot;selected&quot;&gt;Silver&lt;/option&gt;
                                          &lt;option value=&quot;gold&quot;&gt;Gold&lt;/option&gt;
                                          &lt;option value=&quot;diamond&quot;&gt;Diamond&lt;/option&gt;
                                      @elseif($pelanggan-&gt;status_member == &quot;gold&quot;)
                                          &lt;option value=&quot;silver&quot;&gt;Silver&lt;/option&gt;
                                          &lt;option value=&quot;gold&quot; selected=&quot;selected&quot;&gt;Gold&lt;/option&gt;
                                          &lt;option value=&quot;diamond&quot;&gt;Diamond&lt;/option&gt;
                                      @else
                                          &lt;option value=&quot;silver&quot;&gt;Silver&lt;/option&gt;
                                          &lt;option value=&quot;gold&quot; &gt;Gold&lt;/option&gt;
                                          &lt;option value=&quot;diamond&quot; selected=&quot;selected&quot;&gt;Diamond&lt;/option&gt;
                                      @endif                              
                              &lt;/select&gt; 
  </code></pre>