@php
use App\Models\Page;
$clinicName = $settings->get('clinic_name', config('app.name', 'BrightSmile Dental Clinic'));
$tagline = $settings->get('tagline', 'Your Smile, Our Priority');
$phone = $settings->get('phone', '');
$email = $settings->get('email', '');
$address = $settings->get('address', '');
// Fetch only pages that are published and explicitly enabled for the menu.
// Do not rely on variables passed by a controller; this keeps the homepage
// navigation in sync with the Admin > Website Pages records.
$allMenuPages = Page::query()
->where('is_published', 1)
->where('show_in_menu', 1)
->orderBy('menu_order')
->orderBy('title')
->get();
$normalizeTitle = static function ($title) {
return strtolower(trim(preg_replace('/\s+/', ' ', (string) $title)));
};
$reservedTitles = [
'home', 'about', 'about us', 'services', 'service',
'doctors', 'doctor', 'gallery', 'contact', 'book appointment',
];
$reservedSlugs = [
'home', 'about', 'about-us', 'services', 'service',
'doctors', 'doctor', 'gallery', 'contact', 'book-appointment',
];
// If an About Us page exists in Admin and is enabled for the menu, use it.
$pageForAbout = $allMenuPages->first(function ($page) use ($normalizeTitle) {
return in_array(strtolower(trim((string) $page->slug)), ['about', 'about-us'], true)
|| in_array($normalizeTitle($page->title), ['about', 'about us'], true);
});
// Other admin-created pages are inserted into the top navigation here.
$customMenuPages = $allMenuPages->filter(function ($page) use (
$normalizeTitle,
$reservedTitles,
$reservedSlugs
) {
$title = $normalizeTitle($page->title);
$slug = strtolower(trim((string) $page->slug));
return $title !== ''
&& $slug !== ''
&& !in_array($title, $reservedTitles, true)
&& !in_array($slug, $reservedSlugs, true);
})->values();
@endphp
{{ $clinicName }} | {{ $tagline }}
@if($settings->get('favicon'))
@endif
{{-- Top Contact Bar --}}
@if($phone)
📞
{{ $phone }}
@endif
@if($address)
· 📍 {{ $address }}
@endif
{{-- Header and Dynamic Navigation --}}
{{-- Homepage Banner Slider --}}
@forelse($banners as $index => $banner)
@php
$imagePath = trim(str_replace('\\', '/', (string) $banner->image));
if ($imagePath && \Illuminate\Support\Str::startsWith(
$imagePath,
['http://', 'https://', '//']
)) {
$imageUrl = $imagePath;
} else {
$imagePath = preg_replace(
'#^(public/|storage/)#',
'',
ltrim($imagePath, '/')
);
$imageUrl = $imagePath
? asset('storage/'.$imagePath)
: 'https://images.unsplash.com/photo-1629909613654-28e377c37b09?auto=format&fit=crop&w=2200&q=90';
}
@endphp
@empty
@endforelse
@if($banners->count() > 1)
‹
›
@foreach($banners as $index => $banner)
@endforeach
@endif
{{-- Clinic Statistics --}}
{{ $doctors->count() }}+
Clinic Doctors
{{ $services->count() }}+
Dental Services
Modern
Care & Equipment
Patient First
Treatment Approach
{{-- Services Section --}}
Our Services
{{ $settings->get('services_heading', 'Complete Care for Your Smile') }}
{{ $settings->get('services_subheading', 'Explore dental services offered by our clinic.') }}
@forelse($services as $service)
{{ $service->icon ?: '🦷' }}
{{ $service->title }}
{{ $service->description }}
@empty
Our services will be listed here soon.
@endforelse
{{-- About Section --}}
@if($settings->get('about_image'))
@else
@endif
About Our Clinic
{{ $settings->get('about_title', 'Care That Puts Your Smile First') }}
{{ $settings->get('about_text', 'At '.$clinicName.', we believe everyone deserves confident, healthy smiles. Our team focuses on comfortable, modern and patient-centered dental care.') }}
Book Appointment →
{{-- Doctors Section --}}
Our Dental Team
{{ $settings->get('doctors_heading', 'Meet Your Dental Care Team') }}
{{ $settings->get('doctors_subheading', 'Our team is here to support your dental health.') }}
@forelse($doctors as $doctor)
@if($doctor->photo)
@else
@endif
{{ $doctor->name }}
{{ $doctor->qualification }}
{{ $doctor->specialization }}
@if($doctor->bio)
{{ \Illuminate\Support\Str::limit($doctor->bio, 130) }}
@endif
@if($doctor->timetables->isNotEmpty())
Available hours
@foreach($doctor->timetables as $schedule)
{{ $schedule->day_of_week }}
@if($schedule->start_time && $schedule->end_time)
· {{ \Illuminate\Support\Carbon::parse($schedule->start_time)->format('g:i A') }}
– {{ \Illuminate\Support\Carbon::parse($schedule->end_time)->format('g:i A') }}
@endif
@endforeach
@endif
Book with our clinic
@empty
Doctor profiles will appear here when added in the admin panel.
@endforelse
{{-- Gallery Section --}}
Our Gallery
{{ $settings->get('gallery_heading', 'A Look Inside Our Clinic') }}
{{ $settings->get('gallery_subheading', 'Clinic moments and facilities.') }}
@forelse($galleryItems as $item)
@if($item->title)
{{ $item->title }}
@endif
@empty
Gallery photos will appear here when uploaded from the admin panel.
@endforelse
{{-- Contact Section --}}
{{-- Footer --}}
{{-- JavaScript --}}