@if ($location->id)
{!! Form::model($location, ['route' => ['admin.locations.update', ['location' => $location]],
'method' => 'PUT',
'data-stage-id' => $location->id,
]) !!}
@else
{!! Form::model($location, ['route' => ['admin.locations.store'], 'method' => 'POST']) !!}
@endif
{{-- name --}}
{{ Form::label('name', __('Name'), ['class' => 'col-form-label']) }}
{!! Form::text('name', null, ['class' => 'form-control', 'placeholder' => __('Name')]) !!}
{{-- country --}}
{{ Form::label('country_id', __('Country'), ['class' => 'col-form-label']) }}
{!! Form::select('country_id', $countries ?? [], $location->country_id, [
'class' => 'form-select dependent-select',
'data-kt-select2' => 'true',
'data-remote' => route('resource-select', ['Country']),
'data-allow-clear' => 'true',
'data-placeholder' => __('Select Country'),
'id' => 'user-countries-id',
]) !!}
{{-- states --}}
{{ Form::label('state_id', __('State'), ['class' => 'col-form-label']) }}
{!! Form::select('state_id', $states ?? [], $location->state_id, [
'class' => 'form-select dependent-select',
'data-kt-select2' => 'true',
'data-remote' => route('resource-select', ['State']),
'data-allow-clear' => 'true',
'data-placeholder' => __('Select State'),
'data-dependent_id' => 'user-countries-id',
'id' => 'user-state-id',
]) !!}
{{-- cities --}}
{{ Form::label('city_id', __('City'), ['class' => 'col-form-label']) }}
{!! Form::select('city_id', $cities ?? [], $location->city_id, [
'class' => 'form-select dependent-select',
'data-kt-select2' => 'true',
'data-remote' => route('resource-select', ['City']),
'data-allow-clear' => 'true',
'data-placeholder' => __('Select City'),
'data-dependent_id' => 'user-state-id'
]) !!}
{{-- Address --}}
{{ Form::label('address', __('Address'), ['class' => 'col-form-label']) }}
{!! Form::text('address', null, ['class' => 'form-control', 'placeholder' => __('Address')]) !!}
{{-- Latitude --}}
{{ Form::label('latitude', __('Latitude'), ['class' => 'col-form-label']) }}
{!! Form::number('latitude', null, ['class' => 'form-control', 'placeholder' => __('Latitude')]) !!}
{{-- Longitude --}}
{{ Form::label('longitude', __('Longitude'), ['class' => 'col-form-label']) }}
{!! Form::number('longitude', null, ['class' => 'form-control', 'placeholder' => __('Longitude')]) !!}
{{-- Zoom Level --}}
{{ Form::label('zoomLevel', __('Zoom Level'), ['class' => 'col-form-label']) }}
{!! Form::number('zoomLevel', null, ['class' => 'form-control', 'placeholder' => __('Zoom Level')]) !!}
{{-- Owner Type --}}
{{ Form::label('owner_type', __('Owner Type'), ['class' => 'col-form-label']) }}
{!! Form::select('owner_type', [''=> 'Select Type', 'Company' => 'Company', 'Organization' => 'Organization', 'Client' => 'Client'], $ownerType ?? null, [
'class' => 'form-select dependent-select',
'data-kt-select2' => 'true',
'id' => 'location-owner-type-id',
]) !!}
{{-- Owner --}}
{{ Form::label('owner_id', __('Owner'), ['class' => 'col-form-label']) }}
{!! Form::select('owner_id', $owners ?? [], $location->owner_id, [
'class' => 'form-select', 'data-kt-select2' => 'true',
'data-remote' => route('resource-select', ['Owner']),
'data-dependent_id' => 'location-owner-type-id',
'data-allow-clear' => 'true',
'data-placeholder' => __('Select Owner'),
'id' => 'location-owner-id',
]) !!}
{{-- Status --}}
{{ Form::label('status', __('Status'), ['class' => 'col-form-label']) }}
{!! Form::select('status', ['Active' => 'Active', 'Inactive' => 'Inactive'], $location->status, [
'class' => 'form-select', 'data-kt-select2' => 'true'
]) !!}
{{-- is_public --}}
{{-- is_warehouse --}}
{!! Form::close() !!}