Commit de60f2f0 authored by unknown's avatar unknown
Browse files

Restrição que impede o usuário de submeter uma proposta sem discente

parent a5c6815f
......@@ -30,6 +30,10 @@ class StoreTrabalho extends FormRequest
//dd($this->all());
$evento = Evento::find($this->editalId);
$rules = [];
if(!($this->has('marcado'))){
$rules['erro'] = ['required'];
}
if($this->has('marcado')){
foreach ($this->get('marcado') as $key => $value) {
if( intval($value) == $key){
......@@ -65,7 +69,7 @@ class StoreTrabalho extends FormRequest
}
if ($this->has('rascunho')) {
if($this->has('rascunho')) {
$rules = [];
return $rules;
}else{
......
......@@ -32,6 +32,9 @@ class UpdateTrabalho extends FormRequest
$projeto = Trabalho::find($this->id);
$evento = Evento::find($this->editalId);
if(!($this->has('marcado'))){
$rules['erro'] = ['required'];
}
if($this->has('marcado')){
foreach ($this->get('marcado') as $key => $value) {
if( intval($value) == $key){
......
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