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
4837b499
Commit
4837b499
authored
Nov 22, 2022
by
Lucas Henrique
Browse files
Adicionando plano de trabalho ao proponente quando não há participantes
parent
ea95e8c8
Changes
1
Show whitespace changes
Inline
Side-by-side
app/Http/Controllers/TrabalhoController.php
View file @
4837b499
...
@@ -1049,6 +1049,7 @@ class TrabalhoController extends Controller
...
@@ -1049,6 +1049,7 @@ class TrabalhoController extends Controller
]);
]);
}
}
$evento
=
Evento
::
find
(
$request
->
editalId
);
$evento
=
Evento
::
find
(
$request
->
editalId
);
$proponente
=
Proponente
::
where
(
'user_id'
,
Auth
::
user
()
->
id
)
->
first
();
$request
->
merge
([
$request
->
merge
([
'coordenador_id'
=>
$evento
->
coordenadorComissao
->
id
'coordenador_id'
=>
$evento
->
coordenadorComissao
->
id
]);
]);
...
@@ -1148,6 +1149,23 @@ class TrabalhoController extends Controller
...
@@ -1148,6 +1149,23 @@ class TrabalhoController extends Controller
}
}
}
}
else
{
$data
[
'nomePlanoTrabalho'
]
=
$request
->
nomePlanoTrabalho
;
if
(
$request
->
has
(
'anexoPlanoTrabalho'
))
{
$path
=
'trabalhos/'
.
$evento
->
id
.
'/'
.
$trabalho
->
id
.
'/'
;
$nome
=
$data
[
'nomePlanoTrabalho'
]
.
".pdf"
;
$file
=
$request
->
anexoPlanoTrabalho
;
Storage
::
putFileAs
(
$path
,
$file
,
$nome
);
$arquivo
=
new
Arquivo
();
$arquivo
->
titulo
=
$data
[
'nomePlanoTrabalho'
];
$arquivo
->
nome
=
$path
.
$nome
;
$arquivo
->
trabalhoId
=
$trabalho
->
id
;
$arquivo
->
data
=
now
();
$arquivo
->
proponenteId
=
$proponente
->
id
;
$arquivo
->
versaoFinal
=
true
;
$arquivo
->
save
();
}
}
}
}
...
...
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