@props(['key' => null]) {{-- Collapsible "How it works" helper. Content lives in config/how-it-works.php, looked up by the current route name (most-specific segment wins), or by an explicit key: . Renders nothing when no content matches, so it is safe to include on every page. --}} @php $hiwRoute = \Illuminate\Support\Facades\Route::currentRouteName() ?? ''; $hiwCandidates = $key ? [$key] : []; $hiwParts = array_values(array_filter(explode('.', $hiwRoute))); for ($i = count($hiwParts); $i >= 1; $i--) { $hiwCandidates[] = implode('.', array_slice($hiwParts, 0, $i)); } // Flat lookup: keys like "tour.category" contain dots, so config() dot // notation would mis-read them as nesting. $hiwAll = config('how-it-works', []); $hiw = null; foreach ($hiwCandidates as $hiwCandidate) { if ($hiwCandidate && isset($hiwAll[$hiwCandidate])) { $hiw = $hiwAll[$hiwCandidate]; break; } } $hiwId = 'hiw-' . substr(md5(($key ?? '') . '|' . $hiwRoute), 0, 10); @endphp @if($hiw)
{{ admin_label($hiw['title'] ?? ___('admin.how_it_works_1dd6a1')) }}
@if(!empty($hiw['intro']))

{{ admin_label($hiw['intro']) }}

@endif @if(!empty($hiw['steps']))
    @foreach($hiw['steps'] as $hiwStep)
  1. {{ admin_label($hiwStep) }}
  2. @endforeach
@endif @if(!empty($hiw['tips']))
@foreach($hiw['tips'] as $hiwTip)

{{ admin_label($hiwTip) }}

@endforeach
@endif
@once @push('scripts') @endpush @endonce @endif