/**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     if (User::tipoUserLogado() == 'G' || User::tipoUserLogado() == 'U') {
         echo abort(403, 'Acesso não autorizado');
     }
     $binomio = Binomio::findOrFail($id);
     $listaVertente = VertenteBinomio::all('descricao', 'id');
     $listaUnidades = Unidade::all('descricao', 'id');
     $listaMilitares = Militar::all('nome', 'num_mecanografico', 'id');
     $listaCaes = Cao::all('nomeCao', 'num_matricula', 'id');
     return view('binomios.edit', compact('binomio', 'listaVertente', 'listaUnidades', 'listaMilitares', 'listaCaes'));
 }
Esempio n. 2
0
 public function getNomeVertenteAttribute()
 {
     $vertente = VertenteBinomio::findOrFail($this->vertente);
     return $vertente->descricao;
 }