Linux unitednationsplay.com 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
nginx/1.20.1
Server IP : 188.130.139.92 & Your IP : 18.188.161.182
Domains :
Cant Read [ /etc/named.conf ]
User : web
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
home /
www /
1 /
vendor /
musonza /
chat /
src /
Models /
Delete
Unzip
Name
Size
Permission
Date
Action
Conversation.php
12.52
KB
-rw-r--r--
2021-02-02 18:21
Message.php
5.01
KB
-rw-r--r--
2021-02-02 18:21
MessageNotification.php
1.98
KB
-rw-r--r--
2021-02-02 18:21
Participation.php
780
B
-rw-r--r--
2021-02-02 18:21
Save
Rename
<?php namespace Musonza\Chat\Models; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; use Musonza\Chat\BaseModel; use Musonza\Chat\ConfigurationManager; class MessageNotification extends BaseModel { use SoftDeletes; protected $table = ConfigurationManager::MESSAGE_NOTIFICATIONS_TABLE; protected $fillable = ['messageable_id', 'messageable_type', 'message_id', 'conversation_id']; protected $dates = ['deleted_at']; /** * Creates a new notification. * * @param Message $message * @param Conversation $conversation */ public static function make(Message $message, Conversation $conversation) { self::createCustomNotifications($message, $conversation); } public function unReadNotifications(Model $participant) { return self::where([ ['messageable_id', '=', $participant->getKey()], ['messageable_type', '=', $participant->getMorphClass()], ['is_seen', '=', 0], ])->get(); } public static function createCustomNotifications($message, $conversation) { $notification = []; foreach ($conversation->participants as $participation) { $is_sender = ($message->participation_id == $participation->id) ? 1 : 0; $notification[] = [ 'messageable_id' => $participation->messageable_id, 'messageable_type' => $participation->messageable_type, 'message_id' => $message->id, 'participation_id' => $participation->id, 'conversation_id' => $conversation->id, 'is_seen' => $is_sender, 'is_sender' => $is_sender, 'created_at' => $message->created_at, ]; } self::insert($notification); } public function markAsRead() { $this->is_seen = 1; $this->update(['is_seen' => 1]); $this->save(); } }