@extends('layouts.app') @section('title', 'Archive') @section('meta_description', 'Browse all past editions of ' . $siteName) @section('sidebar') @foreach($years as $year) {{ $year }} @endforeach @if($months->count()) @foreach($months as $month) {{ $month->month_label }} @endforeach @endif @endsection @section('content')

Archive @if(request('month'))— {{ \Carbon\Carbon::createFromFormat('Y-m', request('month'))->format('F Y') }}@endif @if(request('year') && !request('month'))— {{ request('year') }}@endif

@if(request()->hasAny(['month','year'])) Clear @endif
@if($newspapers->count())
@foreach($newspapers as $newspaper)
@if($newspaper->pages->count()) {{ $newspaper->publish_date->format('d M Y') }} @else
@endif
{{ $newspaper->publish_date->format('d M Y') }}
@if($newspaper->edition_name)
{{ $newspaper->edition_name }}
@endif
{{ $newspaper->pages_count }} page{{ $newspaper->pages_count !== 1 ? 's' : '' }}
@endforeach
{{ $newspapers->links() }}
@else
No editions found
Clear Filters
@endif @endsection