@extends('frontend.layouts.user.index') @section('title', __('Gift Cards')) @push('styles') @endpush @section('content') @php /* * These two locals MUST live inside @section('content') — * not above it. With @extends at the top of the file, * Blade defers rendering of @section until the parent * layout calls @yield('content'). By that point the * outer @php scope has been unwound and any locals * defined there are gone, so referencing $totalValue or * $statusMap inside the section throws * "Undefined variable" at runtime. */ $statusMap = [ 'pending' => ['label' => __('Pending'), 'cls' => 'warning'], 'scheduled' => ['label' => __('Scheduled'), 'cls' => 'info'], 'delivered' => ['label' => __('Delivered'), 'cls' => 'success'], 'redeemed' => ['label' => __('Redeemed'), 'cls' => 'muted'], 'expired' => ['label' => __('Expired'), 'cls' => 'muted'], 'cancelled' => ['label' => __('Cancelled'), 'cls' => 'danger'], ]; $totalValue = $stats['total_value'] ?? 0; @endphp
{{ __('Designed templates, personal messages, scheduled delivery. Funded straight from your :site wallet.', ['site' => setting('site_title', config('app.name'))]) }}
{{ $card->code }}
· {{ $card->template?->name ?? __('Default') }}
{{ __('Send your first gift card or redeem a code you have received.') }}