@extends('flatlab::layout')

@section('header_title')
    Crear Rol
@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-key'></i> Crear un Rol Nuevo</h3>
        </div>
        <div class="panel-body">
            {{ Form::open(['route' => 'roles.store']) }}
                <div class="form-group">
                    {{ Form::label('name', 'Nombre del Rol') }}
                    {{ Form::text('name', null, array('class' => 'form-control')) }}
                </div>
                <h5>Asignar Permisos</h5>
                @foreach ($permissions as $permission)
                    {{Form::checkbox('permisos[]',  $permission->id) }}
                    {{Form::label($permission->name, ucfirst($permission->name)) }}<br> 
                @endforeach
                {{ 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
