I would like to know if I can return two views in a laravel driver, the version I have is 5.5 and I am trying this way:
Driver:
$info1 = [
'datos' => $datos1,
'nombre' => $nombre
];
$info2 = [
'datos' => $datos2,
'estado' => $estado
];
$documentos1 = view('App.documentos1',['info' => $info1]);
$documentos2 = view('App.documentos2',['info' => $info2]);
$return = [
'documentos1' => $documentos1,
'documentos2' => $documentos2
];
return $return;
View 1:
<div class="col-md-12 panel-grids " style="margin-top:10px;">
<hr>
<div class="panel panel-default">
<div class="panel-heading"> <h3 class="panel-title"><b class="fa fa-money"></b> <b>Lista de Documento</b></h3> </div>
<div class="panel-body table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th>#</th>
<th>Documento</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach ($datos as $key => $value)
<tr class="warning">
<th scope="row">1</th>
<td style="width: 5px;text-align: left;">
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<hr>
</div>
Vista 2:
<div class="col-md-12 panel-grids " style="margin-top:10px;">
<hr>
<div class="panel panel-default">
<div class="panel-heading"> <h3 class="panel-title"><b class="fa fa-money"></b> <b>Lista de Documento Especiales</b></h3> </div>
<div class="panel-body table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th>#</th>
<th>Documento</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach ($datos as $key => $value)
<tr class="warning">
<th scope="row">1</th>
<td style="width: 5px;text-align: left;">
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
<hr>
</div>
Template:
<div class="stats-title">
<h4 class="title">Documentación</h4>
<hr>
</div>
<div class="row">
<div class="col-xs-12 col-md-12 ">
<div id='formulario' class="form-body">
<div class="form-horizontal">
<div class="well">
</div>
<div class="col-md-8">
{!! $sedes !!}
<div id="Documentos1" class="col-md-12"></div>
</div>
<div id="gps" class="col-md-4"></div>
<div id="Documentos2" class="col-md-12"></div>
</div>
</div>
</div>
</div>
<div class="stats-body"> </div>
<div class="clearfix"> </div>
I need to do so since the two lists go in separate parts of the template and by jquery I will locate the returned values but when I return the variable $return;
is empty but I return the variable $documentos1
or $documentos2
, if he returns his sight.