@extends('admin.layouts.layout')

@section('title', 'Novo Vídeo')

@section('content')
<h4>Nova Foto</h4>
<a href="{{route ('videosgaleria.index')}}" class="btn btn-sm btn-block btn-outline-success">Ver todos</a>

@if($errors->any())

<div class="alert alert-danger">
    <ul>
        <h5><i class="icon fas fa-ban"></i> Ocorreu um erro</h5>
        @foreach($errors->all() as $error)
        <li>{{$error}}</li>
        @endforeach
    </ul>
</div>
@endif
<div class="card">
    <div class="card-body">
        <form action="{{route('videosgaleria.update', ['video' => $videos->id])}}" method="POST" class="form-horizontal" enctype="multipart/form-data">
            @method('PUT')
            @csrf
            <div class="box box-info">
                

                <div class="row">
                    <div class="col-md-9">
                        <label class="col-form-label">Categoria </label>
                        <select  class="form-control @error('categoria') is-invalid @enderror" name="categoria">
                            <option name="categoria" value="">Selecione</option>
                            @foreach($videoscategoria as $categoria)
                            <option value="{{$categoria->categoria}}" @if($categoria->categoria == $categoria->categoria) selected @endif>{{$categoria->categoria}}</option>
                            @endforeach
                        </select>
                    </div>
                    <div class="form-group col-md-3">
                        <label class="col-form-label">Data de Cadastro<span>*</span></label>
                        <input type="datetime" name="data_cadastro" value="{{$videos->data_cadastro}}" class="form-control @error('data_cadastro') is-invalid @enderror">
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-form-label">Título do Vídeo<span>*</span></label>
                        <input type="text" name="video_titulo" value="{{$videos->video_titulo}}" class="form-control @error('video_titulo') is-invalid @enderror">
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-form-label">URL do Vídeo<span>*</span></label>
                        <input type="text" name="video_url" value="{{$videos->video_url}}" class="form-control @error('video_url') is-invalid @enderror">
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-form-label">Descrição<span>*</span></label>
                        <input type="text" name="video_descricao" value="{{$videos->video_descricao}}" class="form-control @error('video_descricao') is-invalid @enderror">
                    </div>
                    <div class="form-group col-md-12">
                        <label class="col-form-label">Créditos<span>*</span></label>
                        <input type="text" name="video_credito" value="{{$videos->video_credito}}" class="form-control @error('video_credito') is-invalid @enderror">
                    </div>
                    
            </div>
            <div class="form-group">
                <button type="submit" class="btn btn-outline-success btn-sm btn-block" name="form1">Gravar</button>
        </form>
    </div>
</div>
</div>
</div>
</div>
</div>
@endsection
