@extends('flatlab::layout')

@section('header_title')
    {{ __('flatlab::core.title') }}
@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> Editar Rol: {{$role->name}}</h3>
        </div>
        <div class="panel-body">
            {{ Form::model($role, ['route' => ['roles.update', $role->id], 'method' => 'PUT']) }}
                <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, $role->permissions ) }}
                    {{ Form::label($permission->name, ucfirst($permission->name)) }}<br>
                @endforeach
                <br>
                {{ Form::submit('Guardar Cambios', 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
