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
66574be7
Unverified
Commit
66574be7
authored
Aug 15, 2022
by
GuilhermeGz
Committed by
GitHub
Aug 15, 2022
Browse files
Merge pull request #557 from antonioDurval/master
Remoção da recuperação do plano de trabalho na edição
parents
4bed1d05
167eb1cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/Http/Requests/UpdateTrabalho.php
View file @
66574be7
...
...
@@ -6,7 +6,6 @@ use App\Arquivo;
use
App\Evento
;
use
App\Participante
;
use
App\Trabalho
;
use
App\User
;
use
Illuminate\Validation\Rule
;
use
Illuminate\Support\Facades\Auth
;
use
Illuminate\Foundation\Http\FormRequest
;
...
...
@@ -35,15 +34,7 @@ class UpdateTrabalho extends FormRequest
if
(
$this
->
has
(
'marcado'
)){
foreach
(
$this
->
get
(
'marcado'
)
as
$key
=>
$value
)
{
if
(
intval
(
$value
)
==
$key
){
$usuario
=
User
::
where
(
'email'
,
$this
->
email
[
$value
])
->
first
();
// if(isset($usuario)){
// $participante = Participante::where('user_id', $usuario->id)->where('trabalho_id', $projeto->id)->first();
// $arquivo = Arquivo::where('trabalhoId', $projeto->id)->where('participanteId', $participante->id)->first();
// }
if
(
intval
(
$value
)
==
$key
){
//user
$rules
[
'name.'
.
$value
]
=
[
'required'
,
'string'
];
$rules
[
'email.'
.
$value
]
=
[
'required'
,
'string'
];
...
...
@@ -69,14 +60,8 @@ class UpdateTrabalho extends FormRequest
$rules
[
'media_do_curso.'
.
$value
]
=
[
'required'
,
'string'
];
}
$rules
[
'nomePlanoTrabalho.'
.
$value
]
=
[
'required'
,
'string'
];
$rules
[
'anexoPlanoTrabalho.'
.
$value
]
=
[
'required'
,
'mimes:pdf'
];
if
(
isset
(
$usuario
)){
$participante
=
Participante
::
where
(
'user_id'
,
$usuario
->
id
)
->
where
(
'trabalho_id'
,
$projeto
->
id
)
->
first
();
$arquivo
=
Arquivo
::
where
(
'trabalhoId'
,
$projeto
->
id
)
->
where
(
'participanteId'
,
$participante
->
id
)
->
first
();
$rules
[
'anexoPlanoTrabalho.'
.
$value
]
=
[
Rule
::
requiredIf
(
$arquivo
==
null
),
'mimes:pdf'
];
}
else
{
$rules
[
'anexoPlanoTrabalho.'
.
$value
]
=
[
'required'
,
'mimes:pdf'
];
}
}
}
...
...
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