File: D:/HostingSpaces/SBogers84/zuiderbos.nl/app/views/layouts/partials/posts/latestPosts.blade.php
@foreach($news as $item)
@if(get_class($item) == 'Komma\Kms\Newsletters\Models\Newsletter')
<article>
<a href="/{{$item->routes->filter(function($route) use ($page) {
if( starts_with($route->route, $page->translation->route->route)){
return $route->route;
}
})->first()->route}}">
<figure @if($item->images->count() != 0) style="background-image: url('{{$item->images->first()->medium_image_url}}');" @endif>
</figure>
<div class="content">
{{-- <span class="icon"></span>--}}
<h3>@lang('translations.newsletter') - {{ucfirst(trans('calender.months.'.$item->month))}} {{$item->year}}</h3>
<span class="date">
{{ KommaLang::get('writenOn') }}
{{$item->getDate()->format('j')}} @lang('calender.months.'.$item->getDate()->format('n')) {{$item->getDate()->format('Y')}}
</span>
</div>
</a>
</article>
@else
<article>
<a href="/{{
$item->translations->first()->routes->filter(function($route) use ($page) {
if( starts_with($route->route, $page->root->translation->route->route)){
return $route->route;
}
})->first()->route;
}}">
<figure @if($item->images->count() != 0) style="background-image: url('{{$item->images->first()->medium_image_url}}');" @endif>
</figure>
<div class="content">
{{-- <span class="icon"></span>--}}
<h3>{{$item->translations->first()->name}}</h3>
<span class="date">
{{ KommaLang::get('writenOn') }}
{{$item->getDate()->format('j')}} @lang('calender.months.'.$item->getDate()->format('n')) {{$item->getDate()->format('Y')}}
</span>
</div>
</a>
</article>
@endif
@endforeach