diff --git a/app/DirectMessage.php b/app/DirectMessage.php new file mode 100644 index 000000000..accc92f7f --- /dev/null +++ b/app/DirectMessage.php @@ -0,0 +1,29 @@ +hasOne(Status::class, 'id', 'status_id'); + } + + public function url() + { + return url('/i/message/' . $this->to_id . '/' . $this->id); + } + + public function author() + { + return $this->hasOne(Profile::class, 'id', 'from_id'); + } + + public function me() + { + return Auth::user()->profile->id === $this->from_id; + } +}