@php $category_ids = $model->voucherCategories->pluckToArray('category_id'); @endphp

@foreach($categories as $category) id , $category_ids )}} value='{{$category->id}}'> {{$category->name}}
@endforeach