In Controller ::
$service_names = array();
if(!empty($services_total)){
foreach ($services_total as $value) {
$service_names[] .= $value['name'];
}
}
$service_names = implode(",",$service_names);
if(!empty($services_total)){
foreach ($services_total as $value) {
$service_names[] .= $value['name'];
}
}
$service_names = implode(",",$service_names);
In Blade Page :
@foreach($categories as $value)
<input type="checkbox" name="category_id[]" value="{{$value['id']}}" <?php if(in_array($value['id'], $restaurant_ids)){
echo "checked";
} ?>> {{ ucfirst($value['name']) }}<br>
@endforeach
<input type="checkbox" name="category_id[]" value="{{$value['id']}}" <?php if(in_array($value['id'], $restaurant_ids)){
echo "checked";
} ?>> {{ ucfirst($value['name']) }}<br>
@endforeach
0 comments:
Post a Comment
Thanks