Commit 32172b79 authored by unknown's avatar unknown
Browse files

Correção de erro onde se o usuario nao possuisse proposta e fosse verificar...

Correção de erro onde se o usuario nao possuisse proposta e fosse verificar suas propostas era mostrado um erro, agora ele e redirecionado para a pagina de inicio
parent fae342e7
...@@ -111,11 +111,15 @@ class ProponenteController extends Controller ...@@ -111,11 +111,15 @@ class ProponenteController extends Controller
} }
public function projetosEdital($id) { public function projetosEdital($id) {
$edital = Evento::find($id); $edital = Evento::find($id);
if(Auth::user()->proponentes != null){
$projetos = Trabalho::where('evento_id', '=', $id)->where('proponente_id', Auth::user()->proponentes->id)->orderBy('titulo')->paginate(10); $projetos = Trabalho::where('evento_id', '=', $id)->where('proponente_id', Auth::user()->proponentes->id)->orderBy('titulo')->paginate(10);
$hoje = Carbon::today('America/Recife'); $hoje = Carbon::today('America/Recife');
$hoje = $hoje->toDateString(); $hoje = $hoje->toDateString();
return view('proponente.projetosEdital')->with(['edital' => $edital, 'projetos' => $projetos, 'hoje'=>$hoje]); return view('proponente.projetosEdital')->with(['edital' => $edital, 'projetos' => $projetos, 'hoje'=>$hoje]);
}else{
return redirect()->route('inicial');
}
} }
public function solicitarDesligamento(Request $request){ public function solicitarDesligamento(Request $request){
......
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