@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')
@csrf @if ($branch->exists) @method('put') @endif

{{ __('admin.branch_details') }}

{{ __('admin.branches_help') }}
@foreach ($allLanguages as $index => $language) @endforeach
@foreach ($allLanguages as $index => $language) @endforeach

{{ __('admin.contact_details') }}

{{ __('admin.opening_hours') }}

{{ __('admin.opening_hours_help') }}

@foreach ($openingHours as $day => $slot)
{{ __('admin.day_'.$day) }}
@endforeach

{{ __('admin.branch_gallery') }}

{{ __('admin.branch_gallery_help') }}

@if (is_array($branch->gallery) && $branch->gallery !== []) @endif

{{ __('admin.branch_page_design') }}

{{ __('admin.branch_page_design_help') }}
@foreach ($allLanguages as $index => $language) @endforeach
@foreach ($allLanguages as $index => $language) @endforeach

{{ __('admin.branch_page_builder_help') }}

@if ($branch->exists && auth('admin')->user()?->hasPermission('pages.manage')) {{ __('admin.page_builder') }} @endif

{{ __('admin.branch_location') }}

{{ __('admin.branch_map_help') }}

@endsection @push('head') @endpush @push('scripts') @endpush