@extends('layouts.app') @section('content') @php // Live Uber snapshot (authoritative) with the last applied payload as fallback. $contact = data_get($store, 'contact') ?? []; $location = data_get($store, 'location') ?? []; $orderability = data_get($store, 'orderability') ?? []; $prepTimes = data_get($store, 'prep_times') ?? []; $infoPayload = data_get($settings, 'store_information.payload') ?? []; $statusPayload = data_get($settings, 'store_status.payload') ?? []; $prepPayload = data_get($settings, 'prep_time.payload') ?? []; $syncedAt = data_get($settings, 'synced_at'); $hasStore = filled($integration->account_id); // Prefill helpers: old() (after a validation error) wins, then the live Uber // value, then the last payload we applied. $pick = fn ($field, $live, $applied) => old($field, filled($live) ? $live : (filled($applied) ? $applied : '')); $currentStatus = strtoupper((string) (data_get($orderability, 'status') ?: data_get($statusPayload, 'status'))); $currentPrep = data_get($prepTimes, 'default_value') ?? data_get($prepPayload, 'default_prep_time'); $input = 'block w-full px-3 py-2 text-sm text-stone-800 bg-white border border-stone-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-stone-400 disabled:bg-stone-100 disabled:text-stone-400'; $label = 'block text-xs font-medium text-stone-500'; $disabled = $hasStore ? '' : 'disabled'; @endphp
{{-- HEADER --}}
arrow_back {{ __('Integrations') }}

{{ __('Uber Eats Store Settings') }}

@if ($currentStatus !== '') {{ $currentStatus === 'ONLINE' ? __('Online') : __('Offline') }} @endif

{{ __('Selected business:') }} {{ session('selected_pos_note') ?: __('None') }} @if ($hasStore) · {{ __('Store') }}: {{ $integration->account_id }} @endif

@if ($syncedAt)

{{ __('Last synced from Uber: :time', ['time' => \Illuminate\Support\Carbon::parse($syncedAt)->format('d.m.Y H:i')]) }}

@endif
{{-- FLASH / ERRORS --}} @if (isset($errors) && $errors->any())
{{ $errors->first() }}
@endif @if (! $hasStore)
warning {{ __('No Uber Eats store is bound to this business yet. Reconnect to bind a store, then manage its settings here.') }}
@elseif ($storeError)
cloud_off {{ __('Could not read the live store details from Uber; showing the last saved values.') }} {{ $storeError }}
@endif {{-- STORE INFORMATION --}}
storefront

{{ __('Store Information') }}

{{ __('Contact, location and pickup instructions. Only filled fields are sent to Uber.') }}

@csrf

{{ __('Contact') }}

{{ __('Location') }}

{{-- STORE STATUS --}}
power_settings_new

{{ __('Store Status') }}

{{ __('Bring the store online or take it offline on Uber Eats.') }}

@csrf

{{ __('Leave empty to stay offline indefinitely.') }}

{{-- PREP TIME --}}
timer

{{ __('Preparation Time') }}

{{ __('Default time Uber shows customers before an order is ready.') }}

@csrf

{{ __('min') }} · {{ __('Maximum 10800 seconds (3 hours).') }}

@endsection