@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 = ['verification', 'system', 'user', 'song'];
$notificationStatus = ['unread', 'read'];
$timeAgo = [
'5 minutes ago',
'30 minutes ago',
'1 hour ago',
'3 hours ago',
'Yesterday',
'2 days ago',
];
@endphp
@for ($i = 0; $i < 12; $i++)
@php
$type = $notificationTypes[array_rand($notificationTypes)];
$status = $notificationStatus[array_rand($notificationStatus)];
$time = $timeAgo[array_rand($timeAgo)];
// Set icon based on type
$icon = match ($type) {
'verification' => 'ti-check',
'system' => 'ti-settings',
'user' => 'ti-user',
'song' => 'ti-music',
default => 'ti-bell',
};
// Set color based on type
$color = match ($type) {
'verification' => 'success',
'system' => 'info',
'user' => 'primary',
'song' => 'warning',
default => 'secondary',
};
// Set message based on type
$message = match ($type) {
'verification' => 'New verification request from John Doe',
'system' => 'System update completed successfully',
'user' => 'New user registered: Jane Smith',
'song' => 'New song uploaded: "Amazing Grace"',
default => 'You have a new notification',
};
// Set detail based on type
$detail = match ($type) {
'verification' => 'User has requested Artist verification status',
'system'
=> 'All system components were updated to the latest version',
'user' => 'A new user has joined the platform',
'song' => 'The Weeknd uploaded a new song to their collection',
default => 'Click to view more details about this notification',
};
@endphp
{{ $message }}
{{ $detail }}
{{ $time }}
@endfor --}}