Laporan Keamanan dan Monitoring

@php use Illuminate\Pagination\LengthAwarePaginator; $reportsCollection = collect($reports)->sortByDesc('timestamp'); $currentPage = request()->get('page', 1); $perPage = 1000; $paginatedReports = new LengthAwarePaginator( $reportsCollection->forPage($currentPage, $perPage), $reportsCollection->count(), $perPage, $currentPage, ['path' => request()->url()] ); @endphp @if($paginatedReports->count() > 0)
@foreach($paginatedReports as $key => $report) @endforeach
# Tanggal Perangkat Status Info Selengkapnya
{{ $paginatedReports->firstItem() + $key }} {{ date('d-m-Y H:i:s', strtotime($report['timestamp'])) }} @if($loop->first) Gerakan @elseif($key > 0 && $report['security']['motion'] !== $reports[$key - 1]['security']['motion']) Gerakan @elseif($key > 0 && $report['security']['status'] !== $reports[$key - 1]['security']['status']) Status Keamanan @elseif($key > 0 && $report['smartcab']['last_access'] !== $reports[$key - 1]['smartcab']['last_access']) Akses Terakhir @elseif($key > 0 && $report['smartcab']['servo_status'] !== $reports[$key - 1]['smartcab']['servo_status']) Status Servo @else - @endif @if($loop->first) {{ ucfirst($report['security']['motion']) }} @elseif($key > 0 && $report['security']['motion'] !== $reports[$key - 1]['security']['motion']) {{ ucfirst($report['security']['motion']) }} @elseif($key > 0 && $report['security']['status'] !== $reports[$key - 1]['security']['status']) {{ ucfirst($report['security']['status']) }} @elseif($key > 0 && $report['smartcab']['last_access'] !== $reports[$key - 1]['smartcab']['last_access']) {{ ucfirst($report['smartcab']['last_access']) }} @elseif($key > 0 && $report['smartcab']['servo_status'] !== $reports[$key - 1]['smartcab']['servo_status']) {{ ucfirst($report['smartcab']['servo_status']) }} @else Tidak ada perubahan @endif
{{ $paginatedReports->links('pagination::bootstrap-4') }}
@else
Tidak ada data laporan.
@endif