<x-app-layout>
    @section('title')
    Plat Form List
    @endsection
    <!-- Page Heading -->
    <h1 class="h3 mb-2 text-gray-800">
        @can('Plat Form create')
            <a href="{{ route('admin.platforms.create') }}" class="btn btn-primary"><i class="fas fa-plus" aria-hidden="true"></i>
                Platform Create
            </a>
        @endcan
    </h1>
    <!-- DataTales Example -->
    <div class="card shadow mb-4">
        <div class="card-header py-3">
            <h6 class="m-0 font-weight-bold text-primary">
                Listing Platform Table
            </h6>
        </div>
        <div class="card-body">
            <div class="table-responsive">
                <table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
                    <thead>
                        <tr>
                            <th>SN</th>
                            <th>Image</th>
                            <th>Status</th>
                            <th>Action</th>
                          </tr>
                    </thead>
                    <tbody>

                        @can('Plat Form access')
                            @foreach ($data as $row)
                                <tr>
                                    <td>{{ $loop->index + 1 }}</td>
                                    
                                    <td>
                                        <img src="{{ asset($row->image) }}" alt="Plat Form" class="blog_img_width" />
                                    </td>
                                    <td>
                                        Active
                                    </td>
                                    <td class="d-flex">
                                        @can('Plat Form edit')
                                            <a href="{{ route('admin.platforms.show', $row->id) }}" class="btn btn-secondary btn-sm mr-1"><i class="fas fa-eye"></i></a>
                                            <a href="{{ route('admin.platforms.edit', $row->id) }}" class="btn btn-primary btn-sm mr-1"><i class="fas fa-edit"></i></a>
                                        @endcan

                                        @can('Plat Form delete')
                                            <a id="delete" href="{{ route('admin.platforms.destroy',$row->id) }}"class="btn btn-danger btn-sm"><i class="fas fa-trash"></i></a>
                                        @endcan

                                    </td>
                                </tr>
                            @endforeach
                        @endcan
                    </tbody>
                </table>
            </div>
        </div>
    </div>

    <script>
        function changeStatus(e)
        {
            // console.log(e.href);
            location.href=e.href;
        }
    </script>
</x-app-layout>
