{{ Form::open(['route' => 'booking.assigned','method' => 'post','data-toggle'=>"validator"]) }}
{{ Form::hidden('id',$bookingdata->id) }}
{{ Form::label('handyman_id', __('messages.select_name',[ 'select' => __('messages.handyman') ]).' *',['class'=>'form-control-label'],false) }}
@php
if($bookingdata->booking_address_id != null)
{
$route = route('ajax-list', ['type' => 'handyman', 'provider_id' => $bookingdata->provider_id, 'booking_id' => $bookingdata->id ]);
} else {
$route = route('ajax-list', ['type' => 'handyman', 'provider_id' => $bookingdata->provider_id ]);
}
$assigned_handyman = $bookingdata->handymanAdded->mapWithKeys(function ($item) {
return [$item->handyman_id => optional($item->handyman)->display_name];
});
@endphp
{{ Form::select('handyman_id[]', $assigned_handyman, $bookingdata->handymanAdded->pluck('handyman_id'), [
'class' => 'select2js handyman',
'id' => 'handyman_id',
'required',
'data-placeholder' => __('messages.select_name',[ 'select' => __('messages.handyman') ]),
'data-ajax--url' => $route,
]) }}