When editing a Customer, pre-select its current Mailbox

This commit is contained in:
Antoine Le Gonidec 2024-07-08 17:50:35 +02:00
parent 52985cd5a0
commit 829dcb49ad
Signed by: vv221
GPG key ID: 636B78F91CEB80D8

View file

@ -17,10 +17,18 @@
<div>
<div class="input-group input-group-flex input-sized-lg">
<select class="form-control" name="mailbox" required>
<!-- TODO: Automatically select the Mailbox currently set, if there is one. -->
@if($customer->mailbox_id == null)
<option value="" disabled selected>---</option>
@endif
@foreach($mailboxes as $mailbox)
<option value="{{ $mailbox->id }}">{{ $mailbox->name }}</option>
<option
value="{{ $mailbox->id }}"
@if($mailbox->id == $customer->mailbox_id)
selected
@endif
>
{{ $mailbox->name }}
</option>
@endforeach
</select>
</div>