In my view I have a foreach to bring all the results of a query. And two buttons one to open a page related to its id and another button that opens the id in a modal. The first button works well since when you print each foreach the path to the button is assigned. But do not do the same with the modal. that when you click on modal the selected id shows it to me in the modal, to then use that ID to send it to the route (clients.search, $ id).
view:
@foreach($clientes as $cliente)
<div class="col-md-10 col-md-offset-1">
<div class="cliente-texto">
<a class="cliente-nombre">{{ $cliente -> nombre }}</a>
</div>
<div class="cliente-botones row">
<a class="btn btn-default pull-left" href="{{ route('clientes.perfil', $cliente -> id ) }}" role="button"> Perfil</a>
<a href="#" data-toggle="modal" data-target=".pop-up-1" class="btn btn-danger pull-left" role="button"> Modal</a>
</div>
</div>
@endforeach
Modal:
<!-- Modal contenido -->
<div class="modal fade pop-up-1" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title">Información Importante</h4>
</div>
<div class="modal-body">
<div class="col-sm-12 personal-info">
{!! Form::model('cliente', ['route' => ['clientes.buscar', $cliente -> id],'method' =>'PUT']) !!}
<ul class="list-group row">
<li class="list-group-item col-sm-4 list-group-item-info">El ID Seleccionado es:</li>
<li class="list-group-item col-sm-8"> ?????</li>
</ul>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cerrar</button>
{!! Form::submit('Acepto',['class' => 'btn btn-primary'] ) !!}
</div>
</div>
</div>
</div>