Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Walter Felipe
submeta
Commits
435979b0
Commit
435979b0
authored
Jan 30, 2022
by
Guilherme Silva
Browse files
Adicionada relações de notificação
parent
545187d1
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/Trabalho.php
View file @
435979b0
...
...
@@ -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'
);
}
}
app/User.php
View file @
435979b0
...
...
@@ -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
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment