From 435979b09bfa491399f7dcf83fb0366c4262b271 Mon Sep 17 00:00:00 2001
From: Guilherme Silva <guilherme.dna06@gmail.com>
Date: Sun, 30 Jan 2022 17:44:00 -0300
Subject: [PATCH] =?UTF-8?q?Adicionada=20rela=C3=A7=C3=B5es=20de=20notifica?=
 =?UTF-8?q?=C3=A7=C3=A3o?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 app/Trabalho.php | 3 +++
 app/User.php     | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/app/Trabalho.php b/app/Trabalho.php
index 7d4f4ea..7189958 100755
--- a/app/Trabalho.php
+++ b/app/Trabalho.php
@@ -106,4 +106,7 @@ class Trabalho extends Model
     return $this->hasMany(ParecerInterno::class, 'trab_id', 'id');
   }
 
+  public function notificacoes(){
+      return $this->hasMany(Notificacao::class, 'trabalho_id', 'id');
+  }
 }
diff --git a/app/User.php b/app/User.php
index 43631d0..5f590f2 100755
--- a/app/User.php
+++ b/app/User.php
@@ -106,4 +106,8 @@ class User extends Authenticatable implements MustVerifyEmail
         $this->notify(new VerifyNotification());
     }
 
+    public function notificacoes(){
+        return $this->hasMany(Notificacao::class, 'destinatario_id')->orderBy('created_at', 'desc')->take(5);
+    }
+
 }
-- 
GitLab