-1
In my Professionalcontroller.php file, I have the code:
public function vinculo($id)
{
$profissional = Profissional::find($id);
$unidades = Unidade::all();
$vinculos = Vinculo::where('profissional_id', '=', $id);
return view('profissionais.vinculo', compact('profissional', 'unidades', 'vinculos'));
}
It returns the professional fields and units. However the links are not listed.
My link.blade.php file where the links should appear:
@foreach($vinculos as $vinculo)
<tr>
<td>{{$vinculo->vinculo}}</td>
<td>{{$vinculo->cargo}}</td>
<td>{{$vinculo->funcao}}</td>
<td>{{$vinculo->horario}}</td>
<td>
<a href="{{route('vinculos.edit', $vinculo->id)}}"><i class="glyphicon glyphicon-pencil"></i></a>
<a href="{{route('vinculos.remove', $vinculo->id)}}"><i class="glyphicon glyphicon-trash"></i></a>
<a href="{{route('vinculos.show', $vinculo->id)}}"><i class="glyphicon glyphicon-zoom-in"></i></a>
</td>
</tr>
@endforeach
Read the documentation. There explains that the
get
is used to return results.– Wallace Maxters