Commit 9a0fe5d8 authored by Lucas Henrique's avatar Lucas Henrique
Browse files

Removendo restrição para cadastro de projetos sem discentes

parent 7a07db0f
...@@ -31,9 +31,6 @@ class StoreTrabalho extends FormRequest ...@@ -31,9 +31,6 @@ class StoreTrabalho extends FormRequest
$evento = Evento::find($this->editalId); $evento = Evento::find($this->editalId);
$rules = []; $rules = [];
if(!($this->has('marcado'))){
$rules['erro'] = ['required'];
}
if($this->has('marcado')){ if($this->has('marcado')){
foreach ($this->get('marcado') as $key => $value) { foreach ($this->get('marcado') as $key => $value) {
if( intval($value) == $key){ if( intval($value) == $key){
......
...@@ -32,9 +32,6 @@ class UpdateTrabalho extends FormRequest ...@@ -32,9 +32,6 @@ class UpdateTrabalho extends FormRequest
$projeto = Trabalho::find($this->id); $projeto = Trabalho::find($this->id);
$evento = Evento::find($this->editalId); $evento = Evento::find($this->editalId);
if(!($this->has('marcado'))){
$rules['erro'] = ['required'];
}
if($this->has('marcado')){ if($this->has('marcado')){
foreach ($this->get('marcado') as $key => $value) { foreach ($this->get('marcado') as $key => $value) {
if( intval($value) == $key){ if( intval($value) == $key){
...@@ -67,20 +64,13 @@ class UpdateTrabalho extends FormRequest ...@@ -67,20 +64,13 @@ class UpdateTrabalho extends FormRequest
if($evento->tipo != "PIBEX") { if($evento->tipo != "PIBEX") {
$rules['media_do_curso.' . $value] = ['required', 'string']; $rules['media_do_curso.' . $value] = ['required', 'string'];
} }
$rules['anexoPlanoTrabalho.'.$value] = ['required'];
$rules['nomePlanoTrabalho.'.$value] = ['required', 'string']; $rules['nomePlanoTrabalho.'.$value] = ['required', 'string'];
if($participante !=null){
$arquivo = Arquivo::where('participanteId',$participante->id)->where('trabalhoId',$projeto->id)->first();
if($arquivo == null || $this->nomePlanoTrabalho[$value] != $arquivo->titulo){
$rules['anexoPlanoTrabalho.'.$value] = ['required', 'mimes:pdf'];
}
}else{
$rules['anexoPlanoTrabalho.'.$value] = ['required', 'mimes:pdf'];
}
} }
} }
} }
// dd($this->all()); // dd($this->all());
if ($this->has('rascunho')) { if ($this->has('rascunho')) {
$rules = []; $rules = [];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment