{{-- The public footer — ONE footer for the whole public face of a panel: the landing (frontend.partials.sections) and every content page served by components/layouts/public (services, blog, FAQs, terms, /p/{slug}). It used to live inline inside sections.blade.php, which is why the content pages simply ended mid-air with no legal links and no way back. Extracting it is the fix: one file, so a panel's brand, its social profiles and its published legal pages can never appear on one public page and be missing from the next. PANEL-AWARE, ALWAYS. Everything it prints resolves through the panel of the CURRENT request — a reseller's storefront closes with the reseller's brand, the reseller's social links and the reseller's pages, never the owner's. Rendered from the landing, the caller has already resolved $c / $appName / $logoUrl / $footerPages; rendered from a content page nothing is set, so each one falls back to the same helper the landing controller itself calls. The [data-lp] markers are the Landing Studio's live-patch contract and are inert everywhere else. --}} @php $fc = $c ?? landing_content(); $fAppName = $appName ?? (current_panel()?->name ?: config('app.name', 'RedFamosa')); $fLogoUrl = $logoUrl ?? panel_web_logo_url(); // The landing passes "#top" (it owns that anchor and scrolls to it); every // other page has no #top, so the brand goes home instead of nowhere. $onLanding = isset($footerHome); $fHome = $footerHome ?? url('/'); // The link columns are written for the landing, so half of them are bare // anchors (#pricing, #faq). On a content page those sections do not exist and // the link would do nothing at all — send it to the landing's anchor instead, // which is where the visitor plainly meant to go. $fLink = function (string $url) use ($onLanding) { $resolved = landing_cta_url($url); return (! $onLanding && str_starts_with($resolved, '#') && $resolved !== '#') ? url('/').$resolved : $resolved; }; // Pages the admin flagged show_in_footer (panel-scoped by PanelScope). Only // queried when the caller did not already resolve them. $fPages = $footerPages ?? (current_panel() ? \App\Models\CustomPage::where('show_in_footer', true)->where('status', true)->orderBy('sort')->get() : collect()); // When the panel has pages with show_in_footer=true, suppress any static // "Legal" config column and render the real DB pages instead so the footer // always reflects what the admin actually published. $hasFooterPages = $fPages->isNotEmpty(); $configColumns = array_filter( (array) data_get($fc, 'footer.columns', []), fn ($col) => ! ($hasFooterPages && strtolower($col['title'] ?? '') === 'legal') ); @endphp