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.218.99.99
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 /
Traits /
Delete
Unzip
Name
Size
Permission
Date
Action
Messageable.php
1.33
KB
-rw-r--r--
2021-02-02 18:21
Paginates.php
1.35
KB
-rw-r--r--
2021-02-02 18:21
SetsParticipants.php
939
B
-rw-r--r--
2021-02-02 18:21
Save
Rename
<?php namespace Musonza\Chat\Traits; use Illuminate\Database\Eloquent\Relations\MorphMany; use Musonza\Chat\Exceptions\InvalidDirectMessageNumberOfParticipants; use Musonza\Chat\Models\Conversation; use Musonza\Chat\Models\Participation; trait Messageable { public function conversations() { return $this->participation->pluck('conversation'); } /** * @return MorphMany */ public function participation(): MorphMany { return $this->morphMany(Participation::class, 'messageable'); } public function joinConversation(Conversation $conversation) { if ($conversation->isDirectMessage() && $conversation->participants()->count() == 2) { throw new InvalidDirectMessageNumberOfParticipants(); } $participation = new Participation([ 'messageable_id' => $this->getKey(), 'messageable_type' => $this->getMorphClass(), 'conversation_id' => $conversation->getKey(), ]); $this->participation()->save($participation); } public function leaveConversation($conversationId) { $this->participation()->where([ 'messageable_id' => $this->getKey(), 'messageable_type' => $this->getMorphClass(), 'conversation_id' => $conversationId, ])->delete(); } }