@extends('layouts.dashboard') @section('content') @php /** * Shared personal account edit page for EVERY signed-in role — super_admin, * vendor, the vendor staff sub-roles (manager / kitchen / host / waiter) and the * driver. Rendered inside the dashboard layout, so no header/sidebar here - just * the body. Expects: $user (the signed-in user row), $backUrl (post target for * this area). Optional: $driver (rider row) renders the extra vehicle section. * * Split into sections the same way the Settings pages are: the .qm-settings grid * (sticky nav column + panel column) with .qm-settings-panel sections driven by * qm-tabs.js, so personal details and notification preferences are two * destinations rather than one long scroll. Each section uses the shared card * anatomy (.qm-card-head over .qm-card-body, a .qm-tip on the title for its note) * so this page reads identically to the admin/vendor Settings pages. The two panels * hold independent forms posting to different endpoints, so switching section never * discards anything the other form is holding. */ $backUrl = $backUrl ?? '/'; $user = $user ?? []; $driver = $driver ?? []; /* A number waiting on a texted code, when the host controller requires one. Only the vendor dashboard passes it, so admin and driver render exactly as before. */ $phonePend = is_array($pendingPhone ?? null) ? $pendingPhone : null; @endphp
@php /* Its own form, above the profile: the profile form posts every field it holds, and a code answered inside it would carry the whole profile along with it. Same split the customer account page makes, and cancel is a third form for the same reason. */ @endphp @if ($phonePend)

{{ t_raw('account.phone_verify_title') }}

@php // Raw number into t(): t() escapes the finished sentence, so escaping the // parameter first only got it escaped twice. @endphp

{{ t_raw('account.phone_verify_sub', [':phone' => (string) $phonePend['phone']]) }}

@csrf
@endif
@csrf

{{ t_raw('account.profile_details_title') }}

@php // Picker BESIDE the details rather than stacked above them: a circular avatar // in a full-width block is mostly empty space, and it pushed every field below // the fold. .qm-form-grid for the details, never a Bootstrap .row — a .row // negative-margins itself out of a grid cell and misaligns with the cards. @endphp
@php // Same pick-from-your-library-or-upload picker as every other tenant field // (circular + crop), scoped to the signed-in user's own media via /account/media. @endphp {!! media_field_html('avatar', $user['avatar'] ?? null, ['accept' => 'image', 'circle' => true, 'allowClear' => true, 'endpoint' => '/account/media', 'label' => t_raw('account.profile_photo_label')]) !!}
@php $nd = old('name_display', (string) ($user['name_display'] ?? 'full')); @endphp

{{ t_raw('account.name_display_help') }}

{{ t_raw('account.change_password_heading_dash') }}

@php // Current / new / confirm read as one action, so they share a row rather than // leaving half of one empty. @endphp

{{ t_raw('account.current_password_help') }}

@partial('password-rules', ['for' => 'acc-password']) @php // No policy prose here. The rule is enforced by minlength + pattern, and the // browser states it on a failed submit — spelling it out under the field just // made the card taller than the one beside it. @endphp
@if (staff_has_pin($user))

{{ t_raw('account.change_pin_heading') }}

@endif @if (!empty($driver))

{{ t_raw('account.vehicle_availability_heading') }}

@endif
@php /* THE OWNER'S SAVED CARDS, UNDER THE OWNER'S ACCOUNT, INSIDE THE DASHBOARD — the same manager the customer side renders, not a second one written for vendors. Sending an owner to the public account page to manage a card would drop them out of the dashboard they were working in. */ @endphp @if (\App\Support\Auth::is('vendor'))
@partial('billing-history', ['history' => $billingHistory ?? [], 'pager' => $billingPager ?? []])
@partial('payment-methods', ['methods' => $paymentMethods ?? [], 'savable' => $paymentSavable ?? [], 'publicKey' => $paymentPublicKey ?? ''])
@endif
@partial('notification-prefs', ['returnTab' => 'notifications'])
@endsection