Commit 435979b0 authored by Guilherme Silva's avatar Guilherme Silva
Browse files

Adicionada relações de notificação

parent 545187d1
......@@ -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');
}
}
......@@ -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);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment