1
I am trying after a foreach to access the variable with the object array in the Slide but it displays the Trying to get Property of non-object error. I’ve tried with the "firt" but it only takes the first of house loop in the query, however it works, could help me?
<?php
$artigo = 'short';
$get_cat= DB::table('products')
->where('category', '=', $artigo)
->select('id_product')
->get();
?>
<div>
<a href="#" data-open-in="picker" data-picker-close-text="OK" data-back-on-select="true" class="item-link smart-select" >
<select class="products_qto select-filter-size" name="product" id="product-qto" >
<option selected>TAM</option>
-- @foreach ($get_cat as $key => $tam_prod)
<?php
$tam = DB::table('sizes')
->where('id_product', '=', $tam_prod->id_product)
->select('title')
->get();
?>
<option value="{{$tam->title}}">{{$tam->title}}</option>
@endforeach
</select>
</a>
</div>
<a href="#" onclick="cancelSearchProducts()">LIMPAR</a>
</div>
Oops, all right? I know the code is pretty messed up, but the system wasn’t developed for me, I’m just making some adjustments to a client. The dev that developed shook the project before making controllers and the money they are paying, for now, does not include this job or relate the table in the BD, just an msm, but thank you very much for the reply!
– Caio Carvalho
About the solution, with get o &tam this really with an array of arrays, which he builds every loop in the loop, worked right here Thank you very much!
– Caio Carvalho
You’re welcome.
– emmanuel pires