diff --git a/app/Http/Requests/UpdateTrabalho.php b/app/Http/Requests/UpdateTrabalho.php index ce09032285a498d730a6f29ccb1f5974cbf72a77..83534ac6bce9723515cf2c87259bd6d3f522437d 100755 --- a/app/Http/Requests/UpdateTrabalho.php +++ b/app/Http/Requests/UpdateTrabalho.php @@ -71,9 +71,9 @@ class UpdateTrabalho extends FormRequest } } } else { - $proponente = Proponente::find($projeto->proponente_id); - $rules['anexoPlanoTrabalho'] = [Rule::requiredIf($proponente->planoTrabalho == null)]; - $rules['nomePlanoTrabalho'] = [Rule::requiredIf($proponente->planoTrabalho->titulo == null), 'string']; + $arquivo = Arquivo::where("trabalhoId", $projeto->id)->first(); + $rules['anexoPlanoTrabalho'] = [Rule::requiredIf($arquivo == null)]; + $rules['nomePlanoTrabalho'] = [Rule::requiredIf($arquivo->titulo == null), 'string']; } // dd($this->all()); diff --git a/resources/views/avaliador/listarTrabalhos.blade.php b/resources/views/avaliador/listarTrabalhos.blade.php index acf015013e086fa5b051d04a46f01fbf13ce279c..430c841af94627143594427e466530d7887f23e1 100755 --- a/resources/views/avaliador/listarTrabalhos.blade.php +++ b/resources/views/avaliador/listarTrabalhos.blade.php @@ -87,7 +87,7 @@
diff --git a/resources/views/projeto/formularioVisualizar/proponente2.blade.php b/resources/views/projeto/formularioVisualizar/proponente2.blade.php index 222447254c7ed474c86caf95ebbe89ed3fa87e86..0d5ca1169be895bea5105fbc27e504016e3155af 100644 --- a/resources/views/projeto/formularioVisualizar/proponente2.blade.php +++ b/resources/views/projeto/formularioVisualizar/proponente2.blade.php @@ -77,15 +77,18 @@ @endif @if ($edital->numParticipantes == 0) + @php + $arquivo = App\Arquivo::where("trabalhoId", $projeto->id)->first(); + @endphp