xxxxxxxxxx
php artisan notifications:table
xxxxxxxxxx
@if ($notifications)
@foreach ($notifications as $key => $notification)
@php
$notificationObject = json_decode($notification->data, true);
@endphp
<tr>
<td>{{ ++$key }}</td>
<td>{{ $notification->notifiable_id }}</td>
<td>{{ $notificationObject['name'] }}</td>
<td class="text-center">
<a href="{{ route('notification.edit', [$notification->id]) }}" class="text-primary">
<i class="icon-pencil"></i>
</a>
<a href="{{ route('notification.destroy', [$notification->id]) }}" class="text-danger delete mx-2">
<i class="delete icon-trash"></i>
</a>
</td>
</tr>
@endforeach
@endif
xxxxxxxxxx
<!-- Nav Item - Alerts -->
<li class="nav-item dropdown no-arrow mx-1">
<a class="nav-link dropdown-toggle" href="#" id="alertsDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Notifications<i class="fas fa-bell fa-fw"></i>
@if(Auth::user()->role_id === 1)
<!-- Counter - Alerts -->
<span class="badge badge-danger badge-counter">{{ $jobSeekerProfile->unreadNotifications->where('type', 'App\Notifications\InterviewRequestReceived')->count() > 0 ? $jobSeekerProfile->unreadNotifications->count() : '' }}</span>
@endif
@if(Auth::user()->role_id === 2)
<!-- Counter - Alerts -->
<span class="badge badge-danger badge-counter">{{ Auth::user()->unreadNotifications->where('type', 'App\Notifications\SendJobSeekerResume')->count() }}</span>
@endif
</a>
<!-- Dropdown - Alerts -->
<div class="dropdown-list dropdown-menu dropdown-menu-right shadow animated--grow-in" aria-labelledby="alertsDropdown">
<h6 class="dropdown-header">
Notifications
</h6>
@if(Auth::user()->role_id === 1)
@foreach($jobSeekerProfile->unreadNotifications as $notification)
<a class="dropdown-item d-flex align-items-center" href="#">
@include('layouts.partials.notification.'. Str::snake(class_basename($notification->type)))
</a>
@endforeach
@endif
@if(Auth::user()->role_id === 2)
@foreach(Auth::user()->unreadNotifications as $notification)
<a class="dropdown-item d-flex align-items-center" href="#">
@include('layouts.partials.notification.'. Str::snake(class_basename($notification->type)))
</a>
@endforeach
@endif
<a class="dropdown-item text-center small text-gray-500" href="#">Show All Alerts</a>
</div>
</li>