@extends('admin.layouts.app')

@section('panel')
    <div class="card b-radius--10">
        <div class="card-body p-0">
            <div class="table-responsive--sm table-responsive">
                <table class="table table--light style--two">
                    <thead>
                        <tr>
                            <th>@lang('S#')</th>
                            <th>@lang('Image')</th>
                            <th>@lang('Action')</th>
                        </tr>
                    </thead>
                    <tbody>
                        @forelse($banners as $key => $banner)
                            <tr>
                                <td>{{ $key+1 }}</td>
                                <td>
                                    <img src="{{ asset(getFilePath('banner') . '/' . $banner->file) }}" width="100px" />
                                </td>
                                <td>
                                    <a href="{{ route('admin.banner.edit', $banner->id) }}" class="btn btn--info btn-sm">Edit</a>
                                    <a href="{{ route('admin.banner.delete', $banner->id) }}" class="btn btn--danger btn-sm">Delete</a>
                                </td>
                            </tr>
                        @empty
                            <tr>
                                <td class="text-muted text-center" colspan="100%">No Data Found.</td>
                            </tr>
                        @endforelse
                    </tbody>
                </table>
            </div>
        </div>
    </div>
@endsection

@push('breadcrumb-plugins')
    <a href="{{ route('admin.banner.create') }}" class="btn btn--primary">
        Add New
    </a>
@endpush