Commit 70a33b8f authored by Gabriel-31415's avatar Gabriel-31415
Browse files

add email para submissão

parent ff49ec00
......@@ -847,12 +847,16 @@ class TrabalhoController extends Controller
}
DB::commit();
if (!$request->has('rascunho') ) {
Notification::send(Auth::user(), new SubmissaoNotification($id));
}else{
}
return redirect(route('proponente.projetos'))->with(['mensagem' => 'Proposta atualizada!']);
} catch (\Throwable $th) {
DB::rollback();
return redirect(route('proponente.projetos'))->with(['mensagem' => $th->getMessage()]);
......@@ -952,8 +956,13 @@ class TrabalhoController extends Controller
$trabalho->save();
DB::commit();
return redirect(route('proponente.projetos'))->with(['mensagem' => 'Proposta submetida!']);
if (!$request->has('rascunho') ) {
Notification::send(Auth::user(), new SubmissaoNotification($trabalho->id));
return redirect(route('proponente.projetos'))->with(['mensagem' => 'Proposta submetida!']);
}else{
return redirect(route('proponente.projetos'))->with(['mensagem' => 'Rascunho salvo!']);
}
} catch (\Throwable $th) {
DB::rollback();
return redirect(route('proponente.projetos'))->with(['mensagem' => $th->getMessage()]);
......
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