<table id="example1" class="table table-striped table-bordered">
  <thead >
    <tr >
      <th>{{ trans('products.id') }}</th>
      <th>{{Trans("products.name")}}</th>
      <th>{{Trans("products.product_category")}}</th>
      <th>{{Trans("products.amount")}}</th>
      <th>{{Trans("products.by")}}</th>
      <th>{{Trans("dashboard.crud.created_at")}}</th>
      <th>{{Trans('products.operation_type') }}</th>
      <th>{{Trans("stock.stock")}}</th>
    </tr>
  </thead>
  <tbody>
    <?php $i = 1; ?>
    @foreach($histories as $history)
      <tr data-history="{{$history->id}}" data-url="{{Route('update_ref',$history->id)}}">
        <td>{{ $i }}</td>
        <td>{{ $history->pname }}</td>
        <td>{{ getField("ProductCategory","id",getField('Product','id',$history->product_id,'product_category_id'),"name") }}</td>
        <td>{{ $history->amount }} {{ $history->uname}}</td>
        <td>{{ getField("User","id",$history->user_id,"first_name") }}</td>
        <td>{{ $history->created_at }}</td>
        <td>{{ Trans('products.'.$history->operation_type) }}</td>
        <td>{{ getField("Stock","id",$history->stock_id,"name") }}</td>
      </tr>
      <?php $i ++; ?>
    @endforeach
  </tbody>
</table>
