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
2edd10f2
Commit
2edd10f2
authored
Aug 14, 2022
by
unknown
Browse files
Ajuste na verificação do anexo do plano de trabalho na edição de proposta
parent
846f5f53
Changes
1
Hide whitespace changes
Inline
Side-by-side
app/Http/Requests/UpdateTrabalho.php
View file @
2edd10f2
...
@@ -39,13 +39,10 @@ class UpdateTrabalho extends FormRequest
...
@@ -39,13 +39,10 @@ class UpdateTrabalho extends FormRequest
$usuario
=
User
::
where
(
'email'
,
$this
->
email
[
$value
])
->
first
();
$usuario
=
User
::
where
(
'email'
,
$this
->
email
[
$value
])
->
first
();
// if(isset($usuario)){
$participante
=
Participante
::
where
(
'user_id'
,
$usuario
->
id
)
// $participante = Participante::where('user_id', $usuario->id)->where('trabalho_id', $projeto->id)->first();
->
where
(
'trabalho_id'
,
$projeto
->
id
)
->
first
();
// $arquivo = Arquivo::where('trabalhoId', $projeto->id)->where('participanteId', $participante->id)->first();
// }
$arquivo
=
Arquivo
::
where
(
'trabalhoId'
,
$projeto
->
id
)
->
where
(
'participanteId'
,
$participante
->
id
)
->
first
();
//user
//user
$rules
[
'name.'
.
$value
]
=
[
'required'
,
'string'
];
$rules
[
'name.'
.
$value
]
=
[
'required'
,
'string'
];
...
@@ -72,8 +69,14 @@ class UpdateTrabalho extends FormRequest
...
@@ -72,8 +69,14 @@ class UpdateTrabalho extends FormRequest
$rules
[
'media_do_curso.'
.
$value
]
=
[
'required'
,
'string'
];
$rules
[
'media_do_curso.'
.
$value
]
=
[
'required'
,
'string'
];
}
}
$rules
[
'nomePlanoTrabalho.'
.
$value
]
=
[
'required'
,
'string'
];
$rules
[
'nomePlanoTrabalho.'
.
$value
]
=
[
'required'
,
'string'
];
$rules
[
'anexoPlanoTrabalho.'
.
$value
]
=
[
Rule
::
requiredIf
(
$arquivo
==
null
),
'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