@extends('layouts.mobile') @section('title', 'Notifications - Gletra') @push('styles') @endpush @section('content')
Notifications
@if(auth()->check() && auth()->user()->unreadNotifications->count() > 0)
@csrf
@endif
@if(auth()->check()) @php $notifications = auth()->user()->notifications()->paginate(20); $unreadCount = auth()->user()->unreadNotifications->count(); $totalCount = auth()->user()->notifications()->count(); @endphp
Stay Updated
Orders, offers & important alerts in one place
{{ $totalCount }}
Total
{{ $unreadCount }}
Unread
@if($unreadCount > 0)
Recent Alerts
@csrf
@endif
@forelse($notifications as $notification)
{{ $notification->data['title'] ?? 'System Alert' }}
{{ $notification->created_at->diffForHumans(null, true) }}

{{ $notification->data['message'] ?? '' }}

@if(isset($notification->data['action_url'])) View Details @endif
@empty
No notifications yet

We'll notify you when something important happens.

@endforelse
@if($notifications->hasPages())
{{ $notifications->links() }}
@endif @else
Please Login

Login to see your personalized notifications and updates.

Login / Sign Up
@endif
@endsection