Commit feb1fe31 authored by Yuri Resende's avatar Yuri Resende
Browse files

Correção para atualização dos cadastros de participantes

parent cdd1adac
...@@ -250,6 +250,18 @@ class UserController extends Controller ...@@ -250,6 +250,18 @@ class UserController extends Controller
$id = Auth::user()->id; $id = Auth::user()->id;
$user = User::find($id); $user = User::find($id);
$cursoPart = null; $cursoPart = null;
if($user->participantes()->first() == null){
$participante = Participante::create();
$user->participantes()->save($participante);
}
if($user->endereco()->first() == null){
$endereco = Endereco::create();
$endereco->user()->save($user);
}
if ($user->participantes()->exists() && $user->participantes()->first()->curso_id) if ($user->participantes()->exists() && $user->participantes()->first()->curso_id)
$cursoPart = Curso::find($user->participantes()->first()->curso_id); $cursoPart = Curso::find($user->participantes()->first()->curso_id);
......
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