club message cahnge blade notificaiton count

This commit is contained in:
Jérémy Munsch 2024-07-18 11:40:55 +02:00
parent 8dc8e637e8
commit ad47fda9e6
2 changed files with 3 additions and 13 deletions

View file

@ -29,17 +29,7 @@ class MessageController extends Controller
*/
public function index()
{
/** @var \App\Models\Customer */
$customer = Auth::guard('club')->user();
$unread_messages_count = Message::query()
->whereHas('toCustomer', fn (Builder $q) => $q->where('id', $customer->id))
->where('hide_to', false)
->count();
return view('club.pages.messages.index', compact(
'unread_messages_count'
));
return view('club.pages.messages.index');
}
/**

View file

@ -17,10 +17,10 @@
<div class="col-12 mb-3 text-center">
<span class="header-icon position-relative mb-3">
@include('club.icons.message')
@if ($unread_messages_count)
@if (!empty($notifications_message_count))
<span class="position-absolute start-100 translate-middle bg-danger border-light rounded-circle top-0 border px-2 py-1">
<span class="visually-hidden">{{ __('Nouvelles notifications') }}</span>
<span>{{ $unread_messages_count }}</span>
<span>{{ $notifications_message_count }}</span>
</span>
@endif
</span>