@extends ('layouts.admin')
@section ('title')
SisVentas | Permisos
@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);">Accesos</a></li>
                    <li class="breadcrumb-item active">Permisos</li>
                </ol>
            </div>
            <h4 class="page-title">Administración de Permisos</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-8">
                        <h4 class="header-title">Editar Permisos: {{ $permission->name }}</h4>
                    </div>
                    <div class="col-sm-4">
                        <div class="text-sm-end">
                            <a class="btn btn-primary" href="{{ route('permissions.index') }}"><i class="mdi mdi-reply"></i> Permisos</a>
                        </div>
                    </div><!-- end col-->
                </div>

                <div class="tab-content">
                    <div class="tab-pane show active" id="custom-styles-preview">
                        {!! Form::model($permission, ['route' => ['permissions.update', $permission->id], 'method'=>'PATCH']) !!}
                        <div class="mb-3">
                            <label class="form-label" for="nombre">Nombre:</label>
                            {!! Form::text('name', null, array('placeholder' => 'Nombre','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 tab-content-->

                </div> <!-- end card-body-->
            </div> <!-- end card-->
        </div> <!-- end col-->
    </div>
</div>
    @push ('scripts')
    <script>
        $('#liAcceso').addClass("sub active");
        $('#aAcceso').addClass("active");
        $('#liPermisos').addClass("active");
    </script>
    @endpush
    @endsection