QUOTE(Master Oogway @ Mar 24 2017, 08:32 AM)
hope you could help me
this only return city_name field.
$test = DB::table('products')->join('city', 'products.city_id', '=', 'city.id')->select('city.city_name')->get();
this will return city_name field and all fields in products
$test = DB::table('products')->join('city', 'products.city_id', '=', 'city.id')->select('city.city_name', 'products.*')->get();
this is the view
@foreach ($test as $product)
<tr>
<td>{{ ++$i }}</td>
<td>{{ $product->name}}</td>
<td>{{ $product->details }} </td>
<td>
{{ $product->city_name }}
</td>
@endforeach
try again.