@extends('flatlab::layout')

@section('header_title')
    Crear Permiso
@endsection

@section('main-content')
<div class='col-lg-6 col-lg-offset-3'>
    <div class="panel">
        <div class="panel-heading">
            <h3><i class='fa fa-lock'></i> Crear un Permiso Nuevo</h3>
        </div>
        <div class="panel-body">
            {{ Form::open(['route' => 'permisos.store']) }}
                <div class="form-group">
                    {{ Form::label('name', 'Nombre') }}
                    {{ Form::text('name', '', array('class' => 'form-control')) }}
                </div>
                <br>
                @if(!$roles->isEmpty()) 
                    <h4>Asignar Permiso a Roles</h4>
                    @foreach ($roles as $role) 
                        {{ Form::checkbox('roles[]',  $role->id ) }}
                        {{ Form::label($role->name, ucfirst($role->name)) }}<br>
                    @endforeach
                @endif
                <br>
                {{ Form::submit('Crear', array('class' => 'btn btn-primary')) }}
            {{ Form::close() }}
            <hr>
            @include('flatlab::errors.list')          
        </div>
    </div>
</div>
    
@endsection

@push('extra_css')
    <!-- Enviar un css a la vista principal-->
@endpush

@push('plugins_js')
    <!-- Enviar un plugin a la vista principal-->
@endpush

@push('extra_scripts')
    <!-- Enviar un script a la vista principal-->
@endpush
