@extends('layout.master')

@push('plugin-styles')
@endpush

@section('content')
<div class="row">
    <div class="col s12">
        @include('componentes._breadcrumbs')
    </div>

    <div class="col-lg-12 grid-margin stretch-card">
        <div class="card">

            <div class="card-body">

                <h4 class="card-title">Editar Faq</h4>
                <p class="card-description"> </p>

                @if ($errors->any())
                <div class="alert alert-danger">
                    <ul>
                        @foreach ($errors->all() as $error)
                        <li>{{ $error }}</li>
                        @endforeach
                    </ul>
                </div><br />
                @endif

                <div class="auto-form-wrapper">
                    <form action="{{ route('faq.update', $obj->id)}}" method="post" enctype="multipart/form-data">
                        {{ csrf_field() }}
                        {{ method_field('PUT') }}

                        <div class="row clearfix">
                            <div class="col-sm-6">
                                <div class="form-group">
                                    <div class="input-field">
                                        <select name="language" id="language" class="form-control" required>
                                            <option value="">Selecione um Idioma</option>
                                            <option value="pt" {{ ($obj->language_id = 'pt') ? 'selected' : '' }}>Português</option>
                                            <option value="es" {{ ($obj->language_id = 'es') ? 'selected' : '' }}>Espanhol</option>
                                            <option value="en" {{ ($obj->language_id = 'en') ? 'selected' : '' }}>Inglês</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </div>

                       
                        <div class="row clearfix aba">
                            <div class="col-sm-12">
                                <div class="form-group">
                                    <div class="input-group">
                                        <input type="text" name="pergunta" id="pergunta" class="form-control"
                                                value="{{ ($obj->pergunta) ? $obj->pergunta : old('pergunta')}}"
                                                Placeholder="Pergunta" >
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row clearfix ">
                            <div class="col-sm-12">
                                <div class="form-group">
                                    <p>Resposta</p>
                                    <div class="input-group">
                                        <textarea name="resposta" id="resposta" class="description">{{ ($obj->resposta) ? $obj->resposta : old('resposta')}}</textarea>
                                    </div>
                                </div>
                            </div>
                        </div>
                        

                        <div class="row clearfix">
                            <div class="col-sm-2">
                                <button class="btn btn-primary submit-btn btn-block">Atualizar</button>
                            </div>
                        </div>

                    </form>
                </div>

            </div>
        </div>

    </div>
</div>
@endsection

@push('plugin-scripts')
@endpush

@push('custom-scripts')
@endpush