@foreach($entries as $entry) @php if ($entry->published_at != null) { $published_at = Carbon\Carbon::parse($entry->published_at)->format('Y-m-d'); } else { $published_at = null; } @endphp @include('sitemap.components.news',['title'=>$entry->title, 'url'=>url('/news/'.$entry->unique),'published_at' => $published_at]) @endforeach