@foreach($orders as $key=> $row)
<tr>
    <th scope="row">
        @if ($row->role == 'sub_admin')
            @if (auth()->member()->id != $row->id)
                <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}}"></label>
                </div>
            @endif
        @endif

    </th>
    <td>{{ $row->id }}</td>
    <td>{{ $row->user? ($row->user->role == 'company' ? $row->user->descriptions()->name : $row->user->name) : '' }}</td>
    <td>{{ $row->user? $row->user->phone : '' }}</td>
    <td>{{ __('orders.'.$row->status) }}</td>
    <td>{{ __('orders.'.$row->account_type) }}</td>
    <td colspan="2">{{ \Carbon\Carbon::parse($row->created_at)->format('Y/m/d') }}</td>
    <td>
        @if($row->role == 'super_admin')
            <a href="{{ route ('orders.edit', $row->id) }}" class="icon" title="{{ __('dashboard.edit') }}"><img src="{{ asset('assets/admin/images/icons/draw.svg') }}" alt="{{ __('dashboard.edit') }}"></a>
        @else

            @if($row->deleted_at)
                <a href="{{ route ('orders.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 ('orders.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 ('orders.edit', $row->id) }}" class="icon" title="{{ __('dashboard.edit') }}"><img src="{{ asset('assets/admin/images/icons/draw.svg') }}" alt="{{ __('dashboard.edit') }}"></a>
                            <!--<a href="{{ route ('orders.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>-->

            @endif
        @endif
    </td>
</tr>
@endforeach

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