<?php $__env->startSection('content'); ?>
<h3 class="card-title">Cadastro de Unidade</h3>

<form id="needs-validation" action="<?php echo e(action('BuildingsController@add')); ?>" method="POST" novalidate>
    <?php echo e(csrf_field()); ?>

    <div class="form-row">
        <div class="form-group col-sm-12 col-md-4 col-lg-4">
            <label for="building-name">Nome</label>
            <input type="text" class="form-control" id="building-name" name="name" placeholder="Nome da Unidade" required>
            <div class="invalid-feedback">
                Por favor informe o nome da unidade.
            </div>
        </div>
        <div class="form-group col-sm-12 col-md-8 col-lg-8">
            <label for="building-address">Endereço</label>
            <input type="text" class="form-control" id="building-address" name="address" placeholder="rua numero bairro" required>
            <div class="invalid-feedback">
                Por favor informe o endereço da unidade.
            </div>
        </div>
    </div>
    <div class="form-row">
        <div class="form-group col-sm-12 col-md-12 col-lg-12">
            <label for="building-description">Descrição</label>
            <textarea class="form-control" id="building-description" name="description" placeholder="Digite alguma descrição sobre a unidade"></textarea>
        </div>
    </div>

    <a class="btn btn-danger" role="button" href="<?php echo e(action('BuildingsController@index')); ?>">Cancelar</a>
    <button type="submit" class="btn btn-success">Cadastrar</button>    
</form>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('js'); ?>
<script>
    (function() {
        "use strict";
        window.addEventListener("load", function() {
            var form = document.getElementById("needs-validation");
            form.addEventListener("submit", function(event) {
            if (form.checkValidity() == false) {
                event.preventDefault();
                event.stopPropagation();
            }
            form.classList.add("was-validated");
            }, false);
        }, false);
    }());
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.base', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>