I need to list some boxes in a quote. inside the gallery view add checkbox inside an array to send them to the controller and this sends them to the view that I need to contact. this data comes to the view but it throws me the following error
"Trying to get property of non-object"
Controller
public function ListarCuadrosCotizacion(Request $request){
//recibimos el request enviado desde la galeria
$cuadros = $request->all();
//return $cuadros;
return view('contacto',compact('cuadros'));
}
Route
Route::get('/cotizaciones', [
'as'=>'galeria_cotizacion',
'uses'=>'ProductoController@ListarCuadrosCotizacion'] );
Vista home
@foreach ($cuadros as $cuadro)
<div class="col-md-4 col-xs-6 work">
@if(Storage::disk('images')->has($cuadro->image))
<input class="radio" type="checkbox" name="cuadro[]" value="{{$cuadro}}" >
<img src="{{ url('/miniatura/'.$cuadro->image)}}" />
<div class="work-content">
{{ csrf_field() }}
</div>
@endif
</div>
@endforeach
<button type="submit" class="btn btn-primary">Enviar</button>
</form>
Contact view
<table class="table table-striped">
<thead>
<tr>
<th>id</th>
</tr>
</thead>
<tbody>
<tr>
@foreach($cuadros as $row)
<td>
{{$row->id}}</td>
</tr>
@endforeach
</tbody>
</table>
I leave some of my tests,