@foreach($branches 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>{{ $row->title }}</td>
    <td>{{ $row->address }}</td>
    <td>{{ $row->phone }}</td>
    <td colspan="2">{{ \Carbon\Carbon::parse($row->created_at)->format('Y/m/d') }}</td>
    <td>
        <a href="https://www.google.com/maps/@<?php echo $row->latitude?>,<?php echo $row->longitude?>,15z" target="_blank" class="icon" title="{{ __('branches.map') }}">
            <i class="fa fa-map-marker" style="color: #a00; font-size: 19px"></i>
        </a>
        @if (!in_array($currentUserInfo->role, ['editor', 'contributor']))
            @if($row->deleted_at)
                <a href="{{ route ('branches.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 ('branches.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 ('branches.edit', $row->id) }}" class="icon" title="{{ __('dashboard.edit') }}"><img src="{{ asset('assets/admin/images/icons/draw.svg') }}" alt="{{ __('dashboard.edit') }}"></a>

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

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