Help me again.
I have this in my model
public function quantity()
{
return $this->hasMany('App\Productquantity', 'prod_id', 'id');
}
and I want to get the branch name of each product quantity so the productquantity table has field of branch_id.
How can I display the branch name in branch table?
@forelse($Productquantity->quantity as $dataQuantity)
<tr class="item{{$dataQuantity->id}}">
<td align="center" style="text-align:center" width="100px"> <a href="#" class="avatar"><img src="{{ asset('productimg') }}/{{$dataQuantity->pic}}" width="50px"/></a> </td>
<td style="width:100px;"> {{$Productquantity->product_name}}</td>
<td>{{$dataQuantity->quantity}}</td>
<td>{{$dataQuantity->price}}</td>
<td>{{$dataQuantity->branch_id}}</td>
<td style="width:100px;" class="td-actions"><a href="javascript:;" class="edit-modal btn btn-mini btn-info" data-id="{{$dataQuantity->id}}" ><i class="icon-plus"> </i> Add Stocks</a> </td>
</tr>
@empty
<tr>
<td colspan="5"> <em>No Data</em></td>
</tr>
@endforelse
this {{$dataQuantity->branch_id}} should be displayed the name instead of the branch Id.. Please help.