@php
use Carbon\Carbon;
date_default_timezone_set('Asia/Dhaka');
$current_time = Carbon::now();
$time_of_day = '';
if ($current_time->hour >= 5 && $current_time->hour < 12) {
$time_of_day = 'Morning';
} else if ($current_time->hour >= 12 && $current_time->hour < 18) {
$time_of_day = 'Afternoon';
} else {
$time_of_day = 'Evening';
}
$wishMessage = "Good $time_of_day";
@endphp
{{--
@php
$user = auth()->user();
$notifications = App\Models\Notification::where('reciver_id', $user->id)->where('status', 'unread')->orderBy('created_at', 'desc')->get();
$notifications_count = $notifications->count();
// Push notification to the browser
if ($notifications_count > 0) {
foreach ($notifications as $notification) {
$notification_data = $notification->data;
$notification_id = $notification->id;
$notification_type = $notification->type;
if ($notification_data !== null) {
$notification_title = $notification_data['type'];
$notification_body = $notification_data['message'];
$notification_url = $notification_data['link'];
} else {
// Handle the case when notification data is null
$notification_title = '';
$notification_body = '';
$notification_url = '';
}
$notification_read_at = $notification->status;
if ($notification_read_at == 'unread') {
echo '';
}
}
}
@endphp
--}}