@foreach($users as $key=> $row)
<tr>
    <th scope="row">
        @if ($row->role != 'admin')
            <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>
        @endif

    </th>
    <td>{{ $row->name }}</td>
    <td>{{ $row->email }}</td>
    <td>{{ __('users.'.$row->role) }}</td>
    <td colspan="2">{{ \Carbon\Carbon::parse($row->created_at)->format('Y/m/d') }}</td>
    <td>
        @if($row->role == 'admin')
            <a href="{{ route ('users.edit', $row->id) }}" class="icon" title="{{ __('dashboard.edit') }}"><i class="far fa-edit edit-grid-icon"></i></a>
        @else

            @if($row->deleted_at)
                <a href="{{ route ('users.restore', $row->id) }}" data-method="put" class="icon rowAction" title="{{ __('dashboard.restore') }}"><i class="fas fa-sync-alt restore-grid-icon"></i></a>

                <a href="{{ route ('users.destroy', $row->id) }}" data-method="delete" class="icon rowAction" title="{{ __('dashboard.delete') }}"><i class="fas fa-trash-alt detele-grid-icon"></i></a>
            @else
                <a href="{{ route ('users.edit', $row->id) }}" class="icon" title="{{ __('dashboard.edit') }}"><i class="far fa-edit edit-grid-icon"></i></a>

                <a href="{{ route ('users.destroy', $row->id) }}" data-method="delete" class="icon rowAction" title="{{ __('dashboard.trash') }}"><i class="fas fa-trash trash-grid-icon"></i></a>
            @endif
        @endif
    </td>
</tr>
@endforeach

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