<script>
    $('#permissions-list').select2();
</script>
{!! Form::open(['action'=>['User\UserRolesController@storeAssignPermissionsToUser', 'id'=>$id], 'id'=>'assign-permissions-to-user', 'method'=>'POST']) !!}
<div class="error" style="text-align: center;"><b>On this Window, You can Assign Permissions to a User by the Name: {!! $user->firstName." ".$user->lastName !!}</b></div><br>
<div class="guestDetails_inputDivider"></div>
<button type="submit" disabled style="display: none" aria-hidden="true"></button>
<div class="guestDetails_input">
    <div class="guestDetails_inputLabel">
        {!! Form::label('name', 'Select Permissions') !!}<i class="error">You can Select Multiple Permissions</i><span class="error">*</span>
    </div>
    <div class="guestDetails_input">
        <select multiple="multiple" name="permissions[]" id="permissions-list" style="width: 450px">
            @if($permissions != null)
                @foreach($permissions as $row)
                    <option value="{{$row->id}}" @if($user->hasPermissionTo($row->name)) disabled @endif>{!! $row->name !!}</option>
                @endforeach
            @endif
        </select>
    </div>
</div>
<div class="guestDetails_inputDivider1"></div>
{!! Form::close() !!}

