@forelse ($notifications as $row)
@php
$isUnread = true;
if ($row->read_at != null) {
$isUnread = false;
}
@endphp
{{ $row->message }}
{{ \Carbon\Carbon::parse($row->created_at)->locale('id')->diffForHumans() }}
@empty
belum terdapat data
@endforelse
{{-- @php
$notificationTypes = [
['icon' => 'ti-music', 'color' => 'red', 'animated' => true],
['icon' => 'ti-user-plus', 'color' => 'green', 'animated' => false],
['icon' => 'ti-message', 'color' => 'blue', 'animated' => false],
['icon' => 'ti-heart', 'color' => 'red', 'animated' => false],
['icon' => 'ti-star', 'color' => 'yellow', 'animated' => false]
];
$messages = [
'New song added to your playlist',
'User started following you',
'New comment on your cover',
'Someone liked your song',
'Your song was featured in trending',
'New album release from your favorite artist',
'Your account has been verified',
'License purchase completed',
'Your cover was approved',
'Payment received for your song'
];
$times = [
'Just now',
'5 minutes ago',
'10 minutes ago',
'30 minutes ago',
'1 hour ago',
'2 hours ago',
'Yesterday',
'2 days ago',
'Last week',
'2 weeks ago'
];
@endphp
@for ($i = 0; $i < 12; $i++)
@php
$type = $notificationTypes[$i % count($notificationTypes)];
$message = $messages[$i % count($messages)];
$time = $times[$i % count($times)];
$isUnread = $i < 5;
@endphp
@endfor --}}
{{ $notifications->appends(request()->all())->links() }}
{{-- --}}