@php($autoSave = $historyPosts->where('additional_info', 2)->first())
@php($lastDate = $autoSave ? $autoSave->updated_at->format('Y-m-d') : null)
@if ($autoSave)
Zmiany z {{ \Carbon\Carbon::parse($lastDate)->translatedFormat('d F, Y') }}
@if ($autoSave->category)
{{ $autoSave->category->name }}
@endif
@if ($autoSave->read_time)
{{ $autoSave->read_time }} min
@endif
{{ $autoSave->title }}
{{ $autoSave->updated_at->diffForHumans() }}, {{ $autoSave->updated_at->format('H:i') }}
Autozapis
Porównaj
@endif
@if($lastDate != $currentPost->updated_at->format('Y-m-d'))
@php($lastDate = $currentPost->updated_at->format('Y-m-d'))
@if ($autoSave)
Zmiany z {{ \Carbon\Carbon::parse($lastDate)->translatedFormat('d F, Y') }}
@else
Zmiany z {{ \Carbon\Carbon::parse($currentPost->updated_at)->translatedFormat('d F, Y') }}
@endif
@else
@endif
@if ($currentPost->category)
{{ $currentPost->category->name }}
@endif
@if ($currentPost->read_time)
{{ $currentPost->read_time }} min
@endif
{{ $currentPost->title }}
{{ $currentPost->updated_at->diffForHumans() }}, {{ $currentPost->updated_at->format('H:i') }}
Aktualny
{!! $currentPost->additional_info == 1 ? ' Przywrócono' : '' !!}
@if ($currentPost->changelog)
{{ $currentPost->changeUser->firstname . ' ' . $currentPost->changeUser->lastname }}
{{ $currentPost->changelog }}
@endif
Porównaj
@foreach($historyPosts as $historyPost)
@php($postDate = $historyPost->updated_at->format('Y-m-d'))
@if($lastDate != $postDate && $historyPost->additional_info != 2)
@php($lastDate = $postDate)
Zmiany z {{ \Carbon\Carbon::parse($postDate)->translatedFormat('d F, Y') }}
@elseif($historyPost->additional_info == 2)
@continue
@else
@endif
@if ($historyPost->category)
{{ $historyPost->category->name }}
@endif
@if ($historyPost->read_time)
{{ $historyPost->read_time }} min
@endif
{{ $historyPost->title }}
{{ $historyPost->updated_at->diffForHumans() }}, {{ $historyPost->updated_at->format('H:i') }}
{!! $historyPost->additional_info == 1 ? ' Przywrócono' : '' !!}{!! $historyPost->additional_info == 2 ? ' Autozapis' : '' !!}
@if ($historyPost->changelog)
{{ $historyPost->changeUser->firstname . ' ' . $historyPost->changeUser->lastname }}
{{ $historyPost->changelog }}
@endif
@if ($historyPost->additional_info !== 2)
Przywróć
@endif
Porównaj
@endforeach