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
......@@ -110,12 +110,16 @@ class ProponenteController extends Controller
}
public function projetosEdital($id) {
$edital = Evento::find($id);
$projetos = Trabalho::where('evento_id', '=', $id)->where('proponente_id', Auth::user()->proponentes->id)->orderBy('titulo')->paginate(10);
$hoje = Carbon::today('America/Recife');
$hoje = $hoje->toDateString();
return view('proponente.projetosEdital')->with(['edital' => $edital, 'projetos' => $projetos, 'hoje'=>$hoje]);
$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);
$hoje = Carbon::today('America/Recife');
$hoje = $hoje->toDateString();
return view('proponente.projetosEdital')->with(['edital' => $edital, 'projetos' => $projetos, 'hoje'=>$hoje]);
}else{
return redirect()->route('inicial');
}
}
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