@foreach ($pages as $page)
@switch( $page['type'] )
@case('page')
@case('tool')
@case('contact')
@case('report')
@foreach($page['translations'] as $key => $value)
@if ( $value['robots_meta'] )
@php
try {
$url = localization()->getLocalizedURL($value['locale'], route('home') . '/' . $page['slug'], [], false);
} catch (\Exception $e) {
continue;
}
@endphp
{{ $url }}
{{ Carbon\Carbon::createFromFormat('Y-m-d H:i:s', Carbon\Carbon::parse($page['updated_at']))->tz('UTC')->toAtomString() }}
@endif
@endforeach
@break
@case('post')
@foreach($page['translations'] as $key => $value)
@if ( $value['robots_meta'] )
@php
try {
$url = localization()->getLocalizedURL($value['locale'], route('home') . '/blog/' . $page['slug'], [], false);
} catch (\Exception $e) {
continue;
}
@endphp
{{ $url }}
{{ Carbon\Carbon::createFromFormat('Y-m-d H:i:s', Carbon\Carbon::parse($page['updated_at']))->tz('UTC')->toAtomString() }}
@endif
@endforeach
@break
@case('home')
@foreach($page['translations'] as $key => $value)
@if ( $value['robots_meta'] )
@php
try {
$url = localization()->getLocalizedURL($value['locale'], route('home'), [], false);
} catch (\Exception $e) {
continue;
}
@endphp
{{ $url }}
{{ Carbon\Carbon::createFromFormat('Y-m-d H:i:s', Carbon\Carbon::parse($page['updated_at']))->tz('UTC')->toAtomString() }}
@endif
@endforeach
@break
@default
@endswitch
@endforeach