@php
if(!empty(auth()->user()) && auth()->user()->hasRole('user')){
$auth_user_id=auth()->user()->id;
$favourite = App\Models\UserFavouriteService::where('user_id',$auth_user_id)->get();
}
else{
$auth_user_id=null;
$favourite=null;
}
$serviceData = array_slice($service, 0, 6);
@endphp
@foreach($sub_category as $subCategory)
@php
$filteredServices = array_filter($service, function ($item) use ($subCategory) {
return $item->subcategory_id == $subCategory->id;
});
@endphp
@endforeach