@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)
@php
if(isset($notification->data['ticket_id'])){
$ticket = \App\Models\Ticket\Ticket::where('ticket_id',$notification->data['ticket_id'])->first();
}else{
$ticket = null;
}
if($ticket != null ){
if($ticket->status == 'Closed' && $ticket->closedby_user == Auth::id()){
$stringreplaceurl = route('admin.myclosedtickets', ['ticketdata' => 'myclosedtickets', 'ticketid' => $ticket->id]);
}elseif($ticket->selfassignuser_id == Auth::id()){
$stringreplaceurl = route('admin.mytickets', ['ticketdata' => 'mytickets', 'ticketid' => $ticket->id]);
}else{
$stringreplaceurl = route('admin.unassignedtickets', ['ticketdata' => 'unassignedtickets', 'ticketid' => $ticket->id]);
}
}else{
$stringreplaceurl = '';
}
@endphp
@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') }} {{ lang('View') }}
{{ \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') }} {{ lang('View') }}
{{ \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'] }}
{{ 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'] }}
{{ Str::limit($notification->data['mailtext'], '70') }}{{ lang('View') }}
{{ \Carbon\Carbon::parse($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