@extends('admin.layouts.layout')
@section('content')
    <div class="col-xl-12">
        <div class="card">
            <div class="card-header card-header-bordered">
                <h3 class="card-title">Galeria de Vídeos</h3>
            </div>
            <div class="card-body">
                <p class="text-muted">Cadastro de Galeria de Vídeos no Sistema</p>
            <a class="btn btn-outline-primary btn-block d-grid gap-2" type="button" href="{{route('videosgaleria.create')}}" role="button">Novo video</a>
        </div>
        <div class="card">
            <div class="card-body">

                <!-- Table -->
                <div class="table-responsive">
                    <table class="table table-sm table-hover">
                        <thead>
                            <tr>
                                <th scope="col">Código</th>
                                <th scope="col">Título</th>
                                <th scope="col">Ações</th>
                            </tr>
                        </thead>
                        <tbody>
                            @foreach($videos as $video)
                            <tr>
                                <th scope="row">{{$video->id}}</th>
                                <th scope="row">{{$video->video_titulo}}</th>
                                <td>
                                    <a href="{{ route('videosgaleria.edit', $video->id) }}" class="btn btn-sm btn-outline-warning">Editar</a>
                                    <form class="d-inline" method="POST" action="{{ route('videosgaleria.destroy', $video->id) }}" onSubmit="return confirm('Tem certeza que deseja excluir?')">
                                        @method('DELETE')
                                        @csrf
                                        <button class="btn btn-sm btn-outline-danger">Exluir</button>
                                    </form>
                                </td>
                            </tr>
                            @endforeach

                        </tbody>
                    </table>
                </div>

            </div>
        </div>
    </div>
</div>
@endsection
