@extends('layouts.admin') @section('title', $branch->exists ? __('admin.edit_branch') : __('admin.new_branch')) @section('breadcrumb', __('admin.branches')) @php $defaultLocale = \App\Support\Shop::languages()->firstWhere('is_default', true)?->code ?? config('app.fallback_locale', 'en'); $names = $branch->translations('name'); $addresses = $branch->translations('address'); $workingHours = $branch->translations('working_hours'); $design = (array) ($branch->design ?? []); $designAbout = (array) old('design.about', $design['about'] ?? []); $designLayout = old('design.layout', $design['layout'] ?? 'classic'); $designShowMap = (bool) old('design.show_map', $design['show_map'] ?? true); $selectedTimezone = old('timezone', $branch->timezone); $openingHours = $branch->openingHours(); $savedHours = (array) ($branch->opening_hours ?? []); foreach ($openingHours as $day => $slot) { $openingHours[$day] = [ 'closed' => (bool) old('opening_hours.'.$day.'.closed', $savedHours[$day]['closed'] ?? true), 'open' => old('opening_hours.'.$day.'.open', $slot['open']), 'close' => old('opening_hours.'.$day.'.close', $slot['close']), ]; } $initialLat = old('latitude', $branch->latitude); $initialLng = old('longitude', $branch->longitude); @endphp @section('content')
@endsection @push('head') @endpush @push('scripts') @endpush