@extends($site->themeView('layout')) @php $ads = app(\App\Services\AdManager::class); $intro = $recipe->body ? $recipe->renderedBody()['html'] : ''; $facts = array_filter([ 'prep' => $recipe->prep_minutes ? \App\Models\Recipe::duration((int) $recipe->prep_minutes) : null, 'cook' => $recipe->cook_minutes ? \App\Models\Recipe::duration((int) $recipe->cook_minutes) : null, 'rest' => $recipe->rest_minutes ? \App\Models\Recipe::duration((int) $recipe->rest_minutes) : null, 'total' => \App\Models\Recipe::duration($recipe->totalMinutes()), ]); $steps = collect((array) $recipe->steps)->filter(fn ($s) => filled($s['text'] ?? null))->values(); @endphp {{-- Recipe page: the servings scaler and the ingredient checklist work in the browser (site.js); without JavaScript the recipe reads normally. --}} @section('content')
@include($site->themeView('partials.breadcrumbs')) @if ($recipe->category){{ $recipe->category->name }}@endif

{{ $recipe->title }}

@if ($recipe->summary)

{{ $recipe->summary }}

@endif
@foreach ($facts as $key => $value)
{{ __('recipes.'.$key) }}
{{ $value }}
@endforeach
  • {{ __('recipes.difficulty') }} : {{ __('recipes.difficulties.'.$recipe->difficulty) }}
  • {{ __('recipes.cost') }} : {{ __('recipes.costs.'.$recipe->cost) }}
  • @if ($recipe->cuisine)
  • {{ __('recipes.cuisine') }} : {{ $recipe->cuisine }}
  • @endif @foreach ((array) $recipe->diets as $diet)
  • {{ __('recipes.diets.'.$diet) }}
  • @endforeach

{{ __('recipes.jump') }}

@if ($recipe->image) {{ $recipe->title }} @endif
@if ($intro)
{!! $intro !!}
@endif
{{ $ads->slot('after_title') }}

{{ __('recipes.ingredients') }}

{{ $recipe->servings }} {{ $recipe->servings_unit }}

{{ __('recipes.check_hint') }}

@foreach ($recipe->ingredientGroups() as $group => $items) @if ($group !== '')

{{ $group }}

@endif
    @foreach ($items as $item) @php($qty = \App\Http\Controllers\Site\RecipeController::quantity($item['quantity'] ?? null))
  • @endforeach
@endforeach

{{ __('recipes.steps') }}

    @foreach ($steps as $n => $step)
  1. {{ __('recipes.step', ['n' => $n + 1]) }}

    {{ $step['text'] }}

    @if (! empty($step['minutes']))

    {{ \App\Models\Recipe::duration((int) $step['minutes']) }}

    @endif @if (! empty($step['image']))@endif
  2. @endforeach
@if ($recipe->tips) @endif @if (! empty($recipe->gallery))
    @foreach ($recipe->gallery as $photo)
  • {{ $recipe->title }}
  • @endforeach
@endif @if (! empty($recipe->tags))

{{ __('recipes.tags') }} :@foreach ($recipe->tags as $tag){{ $tag }}@endforeach

@endif
{{ $ads->slot('after_content') }}
@if ($related->isNotEmpty())
@foreach ($related as $item) @include($site->themeView('recipes.partials.card'), ['recipe' => $item]) @endforeach
@endif @endsection