@section('title', 'Branch')
Create New Branch
{!! Form::model($branch, [ 'url' => $branch->exists ? route('backend.branches.update', $branch->id) : route('backend.branches.store'), 'method' => $branch->exists ? 'PUT' : 'POST', 'id' => $branch->exists ? 'branchUpdate' : 'branchCreate', ]) !!}
{!! Form::label('name', 'Branch Name', ['class' => 'form-label']) !!} * {!! Form::text('name', null, ['class' => 'form-control']) !!}
{!! Form::label('country_id', 'Country', ['class' => 'form-label']) !!} * {!! Form::select( 'country_id', ['' => 'Select Country'] + $countriesList, old('country_id', $branch->country_id), [ 'class' => 'form-control form-select select2', 'id' => 'country', ], ) !!}
{!! Form::label('city_id', 'City Name', ['class' => 'form-label']) !!} * {!! Form::select( 'city_id', ['' => 'Select City'] + ($citiesList[$branch->country_id] ?? []), old('city_id', $branch->city_id), [ 'class' => 'form-control form-select select2', 'id' => 'city', ], ) !!}
{!! Form::label('address', 'Address', ['class' => 'form-label']) !!} * {!! Form::textarea('address', old('address'), ['class' => 'form-control']) !!}
{!! Form::submit($branch->exists ? 'Update' : 'Create', ['class' => 'btn btn-primary']) !!}
{!! Form::close() !!}
@push('js') @endpush