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
323bcad2
Commit
323bcad2
authored
Jun 08, 2020
by
carlos
Browse files
relacionamento participante
parent
9f414dff
Changes
3
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/TrabalhoController.php
View file @
323bcad2
...
@@ -205,6 +205,14 @@ class TrabalhoController extends Controller
...
@@ -205,6 +205,14 @@ class TrabalhoController extends Controller
$participante
->
trabalhos
()
->
save
(
$trabalho
);
$participante
->
trabalhos
()
->
save
(
$trabalho
);
}
else
{
}
else
{
$participante
->
user_id
=
$userParticipante
->
id
;
$participante
->
trabalho_id
=
$trabalho
->
id
;
$participante
->
funcao_participante_id
=
$request
->
funcaoParticipante
[
$key
];
$participante
->
save
();
$participante
->
trabalhos
()
->
save
(
$trabalho
);
$subject
=
"Participante de Projeto"
;
$subject
=
"Participante de Projeto"
;
$email
=
$value
;
$email
=
$value
;
Mail
::
to
(
$email
)
Mail
::
to
(
$email
)
...
...
app/Participante.php
View file @
323bcad2
...
@@ -9,7 +9,7 @@ class Participante extends Model
...
@@ -9,7 +9,7 @@ class Participante extends Model
protected
$fillable
=
[
'name'
,
'user_id'
,
'trabalho_id'
,
'participante_id'
];
protected
$fillable
=
[
'name'
,
'user_id'
,
'trabalho_id'
,
'participante_id'
];
public
function
user
(){
public
function
user
(){
return
$this
->
belongsTo
(
'App\User'
);
return
$this
->
belongsTo
Many
(
'App\User'
);
}
}
public
function
trabalhos
(){
public
function
trabalhos
(){
return
$this
->
belongsToMany
(
'App\Trabalho'
,
'trabalho_participante'
);
return
$this
->
belongsToMany
(
'App\Trabalho'
,
'trabalho_participante'
);
...
...
app/User.php
View file @
323bcad2
...
@@ -86,7 +86,7 @@ class User extends Authenticatable implements MustVerifyEmail
...
@@ -86,7 +86,7 @@ class User extends Authenticatable implements MustVerifyEmail
return
$this
->
hasOne
(
'App\AdministradorResponsavel'
);
return
$this
->
hasOne
(
'App\AdministradorResponsavel'
);
}
}
public
function
participantes
(){
public
function
participantes
(){
return
$this
->
has
One
(
'App\Participante'
);
return
$this
->
has
Many
(
'App\Participante'
);
}
}
public
function
avaliadors
(){
public
function
avaliadors
(){
return
$this
->
hasOne
(
'App\Avaliador'
);
return
$this
->
hasOne
(
'App\Avaliador'
);
...
...
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