Ejemplo n.º 1
0
 /**
  *
  * @param \Zbase\Entity\Laravel\User\User $sender
  * @return type
  */
 protected function _msgSender($sender)
 {
     // For the Sender
     $msgSender = new Recipient();
     $msgSender->read_status = 1;
     $msgSender->admin_read_status = 1;
     if ($sender instanceof \Zbase\Entity\Laravel\User\User) {
         $msgSender->user_id = $sender->id();
     }
     $msgSender->trash_status = 0;
     $msgSender->reply_status = 0;
     $msgSender->admin_read_status = 1;
     $msgSender->status = 2;
     $msgSender->is_in = 0;
     $msgSender->is_out = 1;
     $msgSender->message_id = $this->message_id;
     $msgSender->save();
     return $msgSender;
 }
Ejemplo n.º 2
0
 /**
  * Disable Telegram Notifications
  *
  * @return
  */
 public function disableUserTelegram(User $user)
 {
     $user->unsetDataOption('telegram_chat_id');
     $user->save();
     $user->clearEntityCacheById();
     zbase_alert('success', 'Telegram notifications disabled.');
     return true;
 }