在laravel中,我试图向用户发送4种不同类型的通知。这是我的代码部分。
<div class="panel-body">
<ul class="nav" role="tablist">
<li role="presentation">
<a href="{{ url('/approvals/capexapproval') }}">
CAPEX
@if(Auth::user()->unreadNotifications->count()>0)
<span class="badge badge-light">
{{count(Auth::user()->unreadNotifications)}}
</span>
@endif
</a>
</li>
<li role="presentation">
<a href="{{ url('/approvals/creditapproval') }}">
CUSTOMER
@if(Auth::user()->unreadNotifications->count()>0)
<span class="badge badge-light">
{{count(Auth::user()->unreadNotifications)}}
</span>
@endif
</a>
</li>
<li role="presentation">
<a href="{{ url('/approvals/vendorapproval') }}">
VENDOR
@if(Auth::user()->unreadNotifications->count()>0)
<span class="badge badge-light">
{{count(Auth::user()->unreadNotifications)}}
</span>
@endif
</a>
</li>
对于每个菜单,我需要显示收到的邮件数,如果我阅读特定收件箱的邮件,则该特定收件箱的未读通知计数应减少1。