/**
  * Marks one or more alerts as read
  *
  * @param null|int $id
  */
 public function markAsRead($id = null)
 {
     if ($id) {
         $this->alert->update(['is_marked' => true], $id);
     } else {
         if (auth()->user()->alerts_unread) {
             $this->alert->where('user_id', auth()->user() > id)->where('read_at', 'IS', null)->update(['read_at' => Carbon::now()]);
         }
         $this->alert->where('user_id', auth()->user()->id)->update(['is_marked' => true]);
     }
 }