Combine forms

This commit is contained in:
Benjamin Beganović 2024-03-27 17:36:35 +01:00
parent 3473bbe3f7
commit 49b753d3fd

View File

@ -198,6 +198,44 @@
@endif
</div>
<div class="mt-6">
<h1 class="text-2xl font-medium">{{ ctrans('texts.details') }}</h1>
</div>
<div class="grid grid-cols-12 gap-4 mt-10">
@foreach($fields as $field)
@if(!array_key_exists('filled', $field))
<div class="col-span-12 md:col-span-6">
<section class="flex items-center">
<label
for="password_confirmation"
class="input-label">
{{ $field['label'] }}
</label>
</section>
@if($field['name'] == 'client_country_id' || $field['name'] == 'client_shipping_country_id')
<select id="client_country" class="input w-full form-select bg-white" name="{{ $field['name'] }}" wire:model="{{ $field['name'] }}">
<option value="none"></option>
@foreach($countries as $country)
<option value="{{ $country->id }}">
{{ $country->iso_3166_2 }} ({{ $country->name }})
</option>
@endforeach
</select>
@else
<input class="input w-full" type="{{ $field['type'] ?? 'text' }}" name="{{ $field['name'] }}" wire:model="{{ $field['name'] }}">
@endif
@if(session()->has('validation_errors') && array_key_exists($field['name'], session('validation_errors')))
<p class="mt-2 text-gray-900 border-red-300 px-2 py-1 bg-gray-100">{{ session('validation_errors')[$field['name']][0] }}</p>
@endif
</div>
@endif
@endforeach
</div>
<button
type="submit"
class="button button-block bg-primary text-white mt-4">