/ app / Http / Livewire / NotificationBell.php
NotificationBell.php
 1  <?php
 2  
 3  namespace App\Http\Livewire;
 4  
 5  use Livewire\Component;
 6  
 7  class NotificationBell extends Component
 8  {
 9      protected function getListeners()
10      {
11          return ['refresh' => '$refresh'];
12      }
13  
14      public function getNotificationsCountProperty()
15      {
16          return count(auth()->user()->unreadNotifications);
17      }
18  
19      public function render()
20      {
21          return view('livewire.notification-bell');
22      }
23  }