@foreach($products as $key=> $row)
<tr>
    <th scope="row">
        <div class="custom-control custom-checkbox">
            <input type="checkbox" class="custom-control-input selectOne deleteCheck" id="customCheck{{$row->id}}" value="{{$row->id}}" name="id[]">
            <label class="custom-control-label" for="customCheck{{$row->id}}">{{-- $row->id --}}</label>
        </div>
    </th>
        <td style="width: 35px">@if(!is_null($row->image))<img src="{{asset(old('image', $row->image ?? ''))}} " style="width:60px;height: 25px;"  id="image_holder" class="image_holder"/>@else لم يتم اضافة صورة @endif</td>
    <td>{{ $row->name }}</td>
    <td>{{ $row->writer }}</td>
    <td>@if(is_null($row->user_id)) @else {{ $row->admin->name }} @endif</td>
    <td>{{ categoryname($row->category_id) }}</td>

    <td colspan="2">{{ \Carbon\Carbon::parse($row->created_at)->format('Y/m/d') }}</td>
    <td>
        @if($row->deleted_at)
            <a href="{{ route ('products.restore', $row->id) }}" data-method="put" class="icon rowAction" title="{{ __('dashboard.restore') }}"><img src="{{ asset('assets/admin/images/icons/restore.svg') }}" alt="{{ __('dashboard.restore') }}"></a>

            <a href="{{ route ('products.destroy', $row->id) }}" data-method="delete" class="icon rowAction" title="{{ __('dashboard.delete') }}"><img src="{{ asset('assets/admin/images/icons/close.svg') }}" alt="{{ __('dashboard.delete') }}"></a>
        @else
            <a href="{{ route ('products.edit', $row->id) }}" class="icon" title="{{ __('dashboard.edit') }}"><img src="{{ asset('assets/admin/images/icons/draw.svg') }}" alt="{{ __('dashboard.edit') }}"></a>

            <a href="{{ route ('products.destroy', $row->id) }}" data-method="delete" class="icon rowAction" title="{{ __('dashboard.trash') }}"><img src="{{ asset('assets/admin/images/icons/del.svg') }}" alt="{{ __('dashboard.trash') }}"></a>
        @endif
    </td>
</tr>
@endforeach

@if( count( $products ) && $products->hasPages() )
<tr><td> {{ $products->links() }} </td> </tr>
@endif
