@extends ('layouts.admin')
@section ('title')
SisVentas | Editar Categoria
@endsection
@section ('contenido')
<div class="row">
    <div class="col-12">
        <div class="page-title-box">
            <div class="page-title-right">
                <ol class="breadcrumb m-0">
                    <li class="breadcrumb-item"><a href="javascript: void(0);">Inicio</a></li>
                    <li class="breadcrumb-item"><a href="javascript: void(0);">Almacen</a></li>
                    <li class="breadcrumb-item active">Categorias</li>
                </ol>
            </div>
            <h4 class="page-title">Administración de Categorias</h4>
        </div>
    </div>
</div>

<div class="row">
    <div class="col-lg-12">
        <div class="card">
            @if (count($errors) > 0)
            <div class="alert alert-danger">
                <strong>Opps!</strong> Algo salió mal, verifique los errores a continuación.<br><br>
                <ul>
                    @foreach ($errors->all() as $error)
                    <li>{{ $error }}</li>
                    @endforeach
                </ul>
            </div>
            @endif
            <div class="card-body">
                <div class="row mb-2">
                    <div class="col-sm-4">
                        <h4 class="header-title">Editar Categoria: {{ $categoria->nombre }}</h4>
                    </div>
                    <div class="col-sm-8">
                        <div class="text-sm-end">
                            <a class="btn btn-primary" href="{{ route('categoria.index') }}"><i class="mdi mdi-reply"></i> Categorias</a>
                        </div>
                    </div><!-- end col-->
                </div>

                <div class="tab-content">
                    <div class="tab-pane show active" id="custom-styles-preview">
                        {!! Form::model($categoria, ['route' => ['categoria.update', $categoria->idcategoria],'method' => 'PATCH']) !!}
                        <div class="mb-3">
                            <label class="form-label" for="nombre">Nombre:</label>
                            {!! Form::text('nombre', null, array('placeholder' => 'Nombre','class' => 'form-control')) !!}
                        </div>
                        <div class="mb-3">
                            <label class="form-label" for="Descripcion">Descripción:</label>
                            {!! Form::text('descripcion', null, array('placeholder' => 'Descripción','class' => 'form-control')) !!}
                        </div>
                        <button class="btn btn-info" type="submit"><i class="mdi mdi-content-save"></i> Guardar</button>
                        <button class="btn btn-danger" type="reset"><i class="mdi mdi-cancel"></i> Cancelar</button>

                        {!! Form::close() !!}
                    </div> <!-- end preview-->
                </div> <!-- end tab-content-->

            </div> <!-- end card-body-->
        </div> <!-- end card-->
    </div> <!-- end col-->
</div>
<!-- end row -->
@push ('scripts')
<script>
    $('#liAlmacen').addClass("sub active");
    $('#aAlmacen').addClass("active");
    $('#liCategorias').addClass("active");
</script>
@endpush
@endsection