@extends('layouts.partials.master') @section('title', 'Gerir horário') @push('styles') @endpush @section('content')
@include('layouts.components.section-title', ['title' => 'Gerir horário']) Voltar
@include('layouts.components.alerts')
@csrf @method('PUT') @php $intervalErrors = []; foreach ($errors->getMessages() as $key => $messages) { if (preg_match('/^intervals\.(\w+)\.\d+\.(from|to)$/', $key, $matches)) { $day = $matches[1]; $intervalErrors[$day][] = implode(', ', $messages); // You could collect all messages here } } @endphp
@foreach(['monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday'] as $weekDay) @endforeach
weekly_schedule[$weekDay]) && count($store->weekly_schedule[$weekDay]) > 0 ? 'checked' : '' }}>
@if(!empty($intervalErrors[$weekDay]))
@foreach(array_unique($intervalErrors[$weekDay]) as $error)
{{ $error }}
@endforeach
@endif
@if (isset($store->weekly_schedule[$weekDay])) @foreach($store->weekly_schedule[$weekDay] as $key => $interval)
até
@endforeach @if(count($store->weekly_schedule[$weekDay]) > 0) @endif @endif
@endsection @push('scripts') @vite('resources/js/str_stores_schedule/form.js') @endpush