@extends("front.layout.master") @section('title', __('All Flash Deals') . ' | ' . config('app.name')) @section('meta_tags') @endsection @section('body')

{{ __('Flash Deals') }}

{{ __('Limited-time offers — grab them before they end.') }}

{{ method_exists($deals, 'total') ? $deals->total() : count($deals) }}
{{ __('Active campaigns') }}
@if(count($deals))
@foreach($deals as $deal) @php $cover = $deal->background_image && file_exists(public_path('images/flashdeals/' . $deal->background_image)) ? url('images/flashdeals/' . $deal->background_image) : null; $isLive = strtotime($deal->end_date) >= time(); $startsLater = strtotime($deal->start_date) > time(); $itemsCount = $deal->saleitems_count ?? 0; @endphp
@if($cover) {{ $deal->title }} @else
@endif
@if($isLive && !$startsLater) {{ __('Live') }} @elseif($startsLater) {{ __('Upcoming') }} @else {{ __('Ended') }} @endif @if($itemsCount > 0) {{ $itemsCount }} {{ __('items') }} @endif

{{ $deal->title }}

{{ __('Starts') }}
{{ date('d M Y', strtotime($deal->start_date)) }}
{{ date('h:i A', strtotime($deal->start_date)) }}
{{ __('Ends') }}
{{ date('d M Y', strtotime($deal->end_date)) }}
{{ date('h:i A', strtotime($deal->end_date)) }}
{{ $isLive ? __('View Deal') : __('See Items') }}
@endforeach
@if(method_exists($deals, 'links'))
{!! $deals->appends(request()->except('page'))->links() !!}
@endif @else

{{ __('No deals yet') }}

{{ __('No flash sales have been configured. Check back soon!') }}

← {{ __('Back to home') }}
@endif
@endsection