@extends('layouts.dashboard') @section('title', 'Tarieven - ' . $restaurant->name) @section('eyebrow', 'Restaurant') @section('page-title', 'Tarieven en formules') @push('styles') @endpush @section('content') @php $weekdayLabels = ['monday'=>'Maandag','tuesday'=>'Dinsdag','wednesday'=>'Woensdag','thursday'=>'Donderdag','friday'=>'Vrijdag','saturday'=>'Zaterdag','sunday'=>'Zondag']; @endphp
Formulebeheer

Tarieven van {{ $restaurant->name }}

Beheer aparte All You Can Eat- en All You Can Drink-formules, inclusief sessieduur, bestelrondes, inbegrepen categorieën en leeftijdsprijzen.

@if($errors->any())
Controleer de gegevens
    @foreach($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif @if(session('success'))
{{ session('success') }}
@endif
Totaal formules{{ $rates->count() }}
AYCE{{ $rates->where('rate_type', 'ayce_food')->count() }}
AYCD{{ $rates->where('rate_type', 'aycd_drink')->count() }}
Hybride{{ $rates->where('rate_type', 'hybrid')->count() }}
{{ $rates->count() }} {{ $rates->count() === 1 ? 'formule' : 'formules' }}
@if($rates->isEmpty())

Nog geen formules

Maak een eetformule of een aparte, optionele drankformule aan.

@else
@foreach($rates as $rate) @php $typeLabel = match($rate->rate_type) { 'ayce_food' => 'All You Can Eat', 'aycd_drink' => 'All You Can Drink', 'hybrid' => 'Hybride', default => $rate->rate_type, }; $typeIcon = match($rate->rate_type) { 'ayce_food' => 'ri-restaurant-2-line', 'aycd_drink' => 'ri-cup-line', 'hybrid' => 'ri-layout-masonry-line', default => 'ri-price-tag-3-line', }; $ratePayload = [ 'name' => $rate->name, 'description' => $rate->description, 'rate_type' => $rate->rate_type, 'session_duration_minutes' => $rate->session_duration_minutes, 'food_round_interval_minutes' => $rate->food_round_interval_minutes, 'food_items_per_person_per_round' => $rate->food_items_per_person_per_round, 'drink_round_interval_minutes' => $rate->drink_round_interval_minutes, 'drink_items_per_person_per_round' => $rate->drink_items_per_person_per_round, 'weekdays' => $rate->weekdays->pluck('weekday')->all(), 'active' => $rate->active, 'sort_order' => $rate->sort_order, 'menu_category_ids' => $rate->menuCategories ->pluck('id') ->values() ->all(), 'age_prices' => $rate->agePrices ->map(function ($price) { return [ 'label' => $price->label, 'minimum_age' => $price->minimum_age, 'maximum_age' => $price->maximum_age, 'price' => $price->price, 'active' => $price->active, 'sort_order' => $price->sort_order, ]; }) ->values() ->all(), ]; @endphp
{{ $typeLabel }} {{ $rate->active ? 'Actief' : 'Inactief' }}

{{ $rate->name }}

{{ $rate->weekdays->isEmpty() ? 'Hele week' : collect($weekdayLabels)->only($rate->weekdays->pluck('weekday')->all())->implode(' · ') }} {{ $rate->isAvailableNow() ? 'Vandaag beschikbaar' : ($rate->active ? 'Vandaag niet beschikbaar' : 'Inactief') }}

{{ $rate->description ?: 'Nog geen beschrijving ingesteld.' }}

Sessieduur {{ $rate->session_duration_minutes }} min
@if($rate->includesFood())
Eten per ronde {{ $rate->food_items_per_person_per_round }} p.p.
@endif @if($rate->includesDrinks())
Drank per ronde {{ $rate->drink_items_per_person_per_round }} p.p.
@endif
Leeftijdsprijzen {{ $rate->agePrices->count() }}
@forelse($rate->menuCategories as $category) {{ $category->name }} @empty Geen categorieën gekoppeld @endforelse
@foreach($rate->agePrices->take(4) as $price)
{{ $price->label }} € {{ number_format((float) $price->price, 2, ',', '.') }}
@endforeach @if($rate->agePrices->count() > 4) + {{ $rate->agePrices->count() - 4 }} extra prijsregels @endif
@endforeach
@endif
@endsection @push('scripts') @endpush