@php use Botble\BusinessService\Models\ServiceCategory; use Botble\BusinessService\Tables\ServiceCategoryTable; use Botble\Media\Facades\RvMedia; $categories = ServiceCategory::with(['services' => function ($query) { $query->where('status', 'published'); }]) ->whereHas('services') ->orderByDesc('id') // 👈 Order by ID descending ->get(); @endphp
@if ($title = $shortcode->title)

{{ $title }}

@endif @if ($subtitle = $shortcode->subtitle)

{!! $subtitle !!}

@endif
@if($categories->isNotEmpty()) {{-- Nav Tabs --}} {{-- Tab Content --}}
@foreach($categories as $category)
@foreach($category->services as $service)
@if ($image = $service->category->getMetadata('icon', true))
{{ $service->image }}
@endif {{-- Service Image --}} @if ($image = $service->image)
{{ $service->name }}
@endif

{{ $service->name }}

{{ $service->category->name }}

@if ($description = $service->description)

{!! BaseHelper::clean($description) !!}

@endif
@endforeach
@endforeach
@endif {{-- Optional Buttons --}}
@if ($shortcode->button_primary_url && $shortcode->button_primary_label) {{ $shortcode->button_primary_label }} @endif @if($shortcode->button_secondary_url && $shortcode->button_secondary_label) {{ $shortcode->button_secondary_label }} @endif