@extends('layouts.account') @section('title', __('Notifications')) @section('account') @php $m = $shop->money; @endphp

{{ __('Notifications') }}

@forelse ($items as $n) @php $d = $n->data; $isNew = $n->read_at === null; @endphp
@if ($n->type === 'coupon' && !empty($d['code'])) @php $what = match ($d['discount_type'] ?? '') { 'percent' => __(':n% off', ['n' => rtrim(rtrim(number_format((float) $d['discount_value'], 2, '.', ''), '0'), '.')]), 'fixed' => __(':amount off', ['amount' => $m->format((float) $d['discount_value'])]), default => __('Free delivery'), }; @endphp

{{ $isNew ? __('New') . ' ยท ' : '' }}{{ __('A coupon for you') }}

{{ $what }}

@if (!empty($d['min_order'])){{ __('On orders over :amount.', ['amount' => $m->format((float) $d['min_order'])]) }} @endif @if (!empty($d['expires_at'])){{ __('Valid until :date.', ['date' => \Illuminate\Support\Str::limit((string) $d['expires_at'], 10, '')]) }}@endif

{{ $d['code'] }}
{{ __('Shop now') }}
@else

{{ $n->title }}

{{ $n->body }}

@endif

{{ $n->created_at }}

@empty @endforelse @include('partials.pagination', ['result' => $result]) @push('scripts') @endpush @endsection