@if (auth()->user())
@forelse($notifications as $created_at => $notificationss)
@php
$today = \Carbon\Carbon::parse(now());
$yesterday = \Carbon\Carbon::yesterday();
$createdat = \Carbon\Carbon::parse($created_at);
$dateformat1 = \Carbon\Carbon::parse($created_at)->format('Y-m-d');
@endphp
@if ($createdat->format('Y-m-d') == $today->format('Y-m-d'))
Today
@elseif($createdat->format('Y-m-d') == $yesterday->format('Y-m-d'))
Yesterday
@else
{{ $createdat->timezone(Auth::user()->timezone)->format(setting('date_format')) }}
@endif
@foreach ($notificationss as $notification)
@if (array_key_exists('reasonofinfo', $notification->data) && $notification->data['reasonofinfo'] == 'adminreset2fa')
@if ($notification->read_at != null)
{{ Str::limit($notification->data['title'], '50', '...') }}
{{ lang('Removed Two factor authentication', 'notification') }}
{{ lang('Your two factor authentication details are removed by admin.', 'notification') }}
{{ \Carbon\Carbon::parse($notification->created_at)->timezone(Auth::user()->timezone)->format(setting('time_format')) }}
@else
{{ Str::limit($notification->data['title'], '50', '...') }}
{{ lang('Removed Two factor authentication', 'notification') }}
{{ lang('Your two factor authentication details are removed by admin.', 'notification') }}
{{ \Carbon\Carbon::parse($notification->created_at)->timezone(Auth::user()->timezone)->format(setting('time_format')) }}
@endif
@elseif (array_key_exists('ticketassign', $notification->data) && $notification->data['ticketassign'] == 'yes')
@if ($notification->read_at != null)
{{ Str::limit($notification->data['title'], '50', '...') }}
{{ lang('Assigned Ticket', 'notification') }}
{{ $notification->data['ticket_id'] }}
{{ lang('Ticket is assigned.', 'notification') }} {{ lang('View') }}
{{ \Carbon\Carbon::parse($notification->created_at)->timezone(Auth::user()->timezone)->format(setting('time_format')) }}
@else
{{ Str::limit($notification->data['title'], '50', '...') }}
{{ lang('Assigned Ticket', 'notification') }}
{{ $notification->data['ticket_id'] }}
{{ lang('Ticket is assigned.', 'notification') }} {{ lang('View') }}
{{ \Carbon\Carbon::parse($notification->created_at)->timezone(Auth::user()->timezone)->format(setting('time_format')) }}
@endif
@elseif (array_key_exists('draftnotify', $notification->data) && $notification->data['draftnotify'] == 'draftcreated')
@if ($notification->read_at != null)
{{ lang('Draft') }} {{ lang($notification->data['title']) }}
{{ lang('Ticket Draft', 'notification') }}
{{ $notification->data['ticket_id'] }}
{{lang('Ticket Draft is ', 'notification')}} {{ $notification->data['title'] }} {{ lang(' By ') }} {{ lang($notification->data['created_username']) }} {{ lang('View') }}
{{ \Carbon\Carbon::parse($notification->created_at)->timezone(Auth::user()->timezone)->format(setting('time_format')) }}
@else
{{ lang('Draft') }} {{ lang($notification->data['title']) }}
{{ lang('Ticket Draft', 'notification') }}
{{ $notification->data['ticket_id'] }}
{{lang('Ticket Draft is ', 'notification')}} {{ $notification->data['title'] }} {{ lang(' By ') }} {{ lang($notification->data['created_username']) }} {{ lang('View') }}
{{ \Carbon\Carbon::parse($notification->created_at)->timezone(Auth::user()->timezone)->format(setting('time_format')) }}
@endif
@else
@if ($notification->data['status'] == 'New')
@if ($notification->read_at != null)
{{ Str::limit($notification->data['title'], '50', '...') }}
{{ lang('New Ticket', 'notification') }}
{{ lang('A new ticket has been created', 'notification') }}
{{ $notification->data['ticket_id'] }} {{ lang('View') }}
{{ \Carbon\Carbon::parse($notification->created_at)->timezone(Auth::user()->timezone)->format(setting('time_format')) }}
@else
{{ Str::limit($notification->data['title'], '50', '...') }}
{{ lang('New Ticket', 'notification') }}
{{ lang('A new ticket has been created', 'notification') }}
{{ $notification->data['ticket_id'] }} {{ lang('View') }}
{{ \Carbon\Carbon::parse($notification->created_at)->timezone(Auth::user()->timezone)->format(setting('time_format')) }}
@endif
@endif
@if ($notification->data['status'] == 'Closed')
@if ($notification->read_at != null)
{{ Str::limit($notification->data['title'], '50', '...') }}
{{ lang('Closed Ticket', 'notification') }}
{{ lang('This ticket has been closed', 'notification') }}
{{ $notification->data['ticket_id'] }} {{ lang('View') }}
{{ \Carbon\Carbon::parse($notification->created_at)->timezone(Auth::user()->timezone)->format(setting('time_format')) }}
@else
{{ Str::limit($notification->data['title'], '50', '...') }}
{{ lang('Closed Ticket', 'notification') }}
{{ lang('This ticket has been closed', 'notification') }}
{{ $notification->data['ticket_id'] }} {{ lang('View') }}
{{ \Carbon\Carbon::parse($notification->created_at)->timezone(Auth::user()->timezone)->format(setting('time_format')) }}
@endif
@endif
@if ($notification->data['status'] == 'On-Hold')
@if ($notification->read_at != null)
{{ Str::limit($notification->data['title'], '50', '...') }}
{{ lang('On-Hold Ticket', 'notification') }}
{{ lang('This ticket status is On-Hold', 'notification') }}
{{ $notification->data['ticket_id'] }} {{ lang('View') }}
{{ \Carbon\Carbon::parse($notification->created_at)->timezone(Auth::user()->timezone)->format(setting('time_format')) }}
@else
{{ Str::limit($notification->data['title'], '50', '...') }}
{{ lang('On-Hold Ticket', 'notification') }}
{{ lang('This ticket status is On-Hold', 'notification') }}
{{ $notification->data['ticket_id'] }} {{ lang('View') }}
{{ \Carbon\Carbon::parse($notification->created_at)->timezone(Auth::user()->timezone)->format(setting('time_format')) }}
@endif
@endif
@if ($notification->data['status'] == 'Re-Open')
@if ($notification->read_at != null)
{{ Str::limit($notification->data['title'], '50', '...') }}
{{ lang('Re-Open Ticket', 'notification') }}
{{ lang('This ticket has been reopened', 'notification') }}
{{ $notification->data['ticket_id'] }} {{ lang('View') }}
{{ \Carbon\Carbon::parse($notification->created_at)->timezone(Auth::user()->timezone)->format(setting('time_format')) }}
@else
{{ Str::limit($notification->data['title'], '50', '...') }}
{{ lang('Re-Open Ticket', 'notification') }}
{{ lang('This ticket has been reopened', 'notification') }}
{{ $notification->data['ticket_id'] }} {{ lang('View') }}
{{ \Carbon\Carbon::parse($notification->created_at)->timezone(Auth::user()->timezone)->format(setting('time_format')) }}
@endif
@endif
@if ($notification->data['status'] == 'Inprogress')
@if ($notification->data['overduestatus'] == 'Overdue')
@if ($notification->read_at != null)
{{ Str::limit($notification->data['title'], '50', '...') }}
{{ lang('Overdue Ticket', 'notification') }}
{{ lang('This ticket status is overdue', 'notification') }}
{{ $notification->data['ticket_id'] }} {{ lang('View') }}
{{ \Carbon\Carbon::parse($notification->created_at)->timezone(Auth::user()->timezone)->format(setting('time_format')) }}
@else
{{ Str::limit($notification->data['title'], '50', '...') }}
{{ lang('Overdue Ticket', 'notification') }}
{{ lang('This ticket status is overdue', 'notification') }}
{{ $notification->data['ticket_id'] }} {{ lang('View') }}
{{ \Carbon\Carbon::parse($notification->created_at)->timezone(Auth::user()->timezone)->format(setting('time_format')) }}
@endif
@else
@if ($notification->read_at != null)
{{ Str::limit($notification->data['title'], '50', '...') }}
{{ lang('Inprogress Ticket', 'notification') }}
{{ lang('You got a new reply on this ticket', 'notification') }}
{{ $notification->data['ticket_id'] }} {{ lang('View') }}
{{ \Carbon\Carbon::parse($notification->created_at)->timezone(Auth::user()->timezone)->format(setting('time_format')) }}
@else
{{ Str::limit($notification->data['title'], '50', '...') }}
{{ lang('Inprogress Ticket', 'notification') }}
{{ lang('You got a new reply on this ticket', 'notification') }}
{{ $notification->data['ticket_id'] }} {{ lang('View') }}
{{ \Carbon\Carbon::parse($notification->created_at)->timezone(Auth::user()->timezone)->format(setting('time_format')) }}
@endif
@endif
@endif
@if ($notification->data['status'] == 'mail')
@if ($notification->read_at != null)
{{ $notification->data['mailsubject'] }}{{ $notification->data['mailsendtag'] }}
{{ strip_tags(Str::limit($notification->data['mailtext'], '70')) }}{{ lang('View') }}
{{ \Carbon\Carbon::parse($notification->created_at)->timezone(Auth::user()->timezone)->format(setting('time_format')) }}
@else
{{ $notification->data['mailsubject'] }}
{{ $notification->data['mailsendtag'] }}
{{ strip_tags(Str::limit($notification->data['mailtext'], '70')) }}{{ lang('View') }}
{{ \Carbon\Carbon::parse($notification->created_at)->timezone(Auth::user()->timezone)->format(setting('time_format')) }}
@endif
@endif
@if(($notification->data['status'] == 'invoice') && ($notification->data['itemStatus'] == 'pending'))
@php
$id = decrypt($notification->data['invoice_id']);
// $id = $notification->data['invoice_id'];
$invoiceExists = \App\Models\AllTransactions::where('invoiceId', $id)->exists();
@endphp
@if($notification->read_at != null)
{{ lang('New custom invoice created.')}}
{{ lang('Custom Invoice Created', 'notification') }}
{{ Str::limit(lang('A new custom invoice is created', 'notification'), '30' , '...' ) }}
@if($invoiceExists) {{lang('View')}} @else {{lang('Invoice Deleted')}} @endif
{{$notification->created_at->timezone(Auth::user()->timezone)->format(setting('time_format'))}}
@else
{{ lang('New custom invoice created.')}}
{{ lang('Custom Invoice Created', 'notification') }}
{{ Str::limit(lang('A new custom invoice is created', 'notification'), '30' , '...' ) }}
@if($invoiceExists) {{lang('View')}} @else {{lang('Invoice Deleted')}} @endif
{{$notification->created_at->timezone(Auth::user()->timezone)->format(setting('time_format'))}}
@endif
@endif
@if(($notification->data['status'] == 'invoice') && ($notification->data['itemStatus'] == 'refundpending'))
@if($notification->read_at != null)
{{ lang('Recieved a new refund request.') }}
{{lang('Refund Request', 'notification')}}
{{ Str::limit($notification->data['reason'], '30') }} {{ lang('Invoice Id') }} #{{ $notification->data['invoice_id'] }} {{lang('View')}}
{{$notification->created_at->timezone(Auth::user()->timezone)->format(setting('time_format'))}}
@else
{{ lang('Recieved a new refund request.') }}
{{lang('Refund Request', 'notification')}}
{{ Str::limit($notification->data['reason'], '30') }} {{ lang('Invoice Id') }} #{{ $notification->data['invoice_id'] }} {{lang('View')}}
{{$notification->created_at->timezone(Auth::user()->timezone)->format(setting('time_format'))}}
@endif
@endif
@if(($notification->data['status'] == 'invoice') && ($notification->data['itemStatus'] == 'refunded'))
@if($notification->read_at != null)
{{ lang('Refund request approved') }}
{{lang('Refund Approved', 'notification')}}
{{ Str::limit($notification->data['reason'], '30') }} {{ lang('Invoice Id') }} #{{ $notification->data['invoice_id'] }} {{lang('View')}}
{{$notification->created_at->timezone(Auth::user()->timezone)->format(setting('time_format'))}}
@else
{{ lang('Refund request approved') }}
{{lang('Refund Approved', 'notification')}}
{{ Str::limit($notification->data['reason'], '30') }} {{ lang('Invoice Id') }} #{{ $notification->data['invoice_id'] }} {{lang('View')}}
{{$notification->created_at->timezone(Auth::user()->timezone)->format(setting('time_format'))}}
@endif
@endif
@endif
@endforeach
@empty
{{ lang('There are no new notifications to display', 'notification') }}
{{ lang('There are no notifications. We will notify you when the new notification arrives.', 'notification') }}
@endforelse
{{ auth()->user()->notifications()->paginate(10)->links('admin.notificationpagination') }}
@endif