Commit 590ed5ea authored by GuilhermeGz's avatar GuilhermeGz
Browse files

Alteração na atualização de endereço

parent 8a05eb02
......@@ -887,7 +887,6 @@ class TrabalhoController extends Controller
if ($request->has('marcado')) {
foreach ($request->marcado as $key => $part) {
$part = intval($part);
$passwordTemporario = Str::random(8);
$data['name'] = $request->name[$part];
$data['email'] = $request->email[$part];
......@@ -946,8 +945,13 @@ class TrabalhoController extends Controller
} else {
// $user = $participante->user;
$user->update($data);
$endereco = $user->endereco;
$endereco->update($data);
if( $user->endereco == null){
$endereco = Endereco::create($data);
$endereco->user()->save($user);
}else{
$endereco = $user->endereco;
$endereco->update($data);
}
$participante = $user->participantes->where('trabalho_id', $trabalho->id)->where('id', $request->participante_id[$part])->first();
// dd($participante);
if ($participante == null) {
......
......@@ -321,8 +321,7 @@
<select name="ordem_prioridade[]" class="form-control" >
<option value="" selected>-- ORDEM --</option>
@for($j = 1; $j <= $edital->numParticipantes; $j++)
<option @if(old('total_periodos')[$i] ?? $participante->ordem_prioridade == $j ) selected @endif value="{{ $j }}">{{ $j }}</option>
@endfor
<option @if(old('total_periodos')[$i] ?? ($participante->ordem_prioridade ?? '') == $j ) selected @endif value="{{ $j }}">{{ $j }}</option> @endfor
</select>
@error('ordem_prioridade.'.$i)
......
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