<script type="text/javascript">
    $(".modal-title").text("Edit User Group");
</script>
<style type="text/css">
    .workingDay label{
        font-weight: 400;
    }
</style>
{!! Form::model($result,['url'=>['user-group',$result->id],'id'=>'myForm','novalidate'=>'','method'=>'PUT']) !!}
<div class="content">
    <div class="row">
        <div class="col-md-12">
            <div class="form-group">
                <label class="control-label">Title</label>
                <input class="form-control" name="title" value="{{$result->title}}" type="text"  placeholder="User Group Name"/>
            </div>
        </div>
        <div class="col-md-12">
            <div class="form-group">
                <label class="control-label">Working Days</label>
                <div class="workingDay">
                    <?php
                        $days=['Saturday','Sunday','Monday','Tuesday','Wednesday','Thursday','Friday'];
                        $workingDays= json_decode($result->working_day,true);
                    ?>
                    @foreach($days as $key=> $day)
                            <?php $found=0; ?>
                        @if(count($workingDays)>0)
                            @foreach($workingDays as $workingDay)
                                @if($day==$workingDay)
                                    <?php $found=1; ?>
                                @endif
                            @endforeach
                        @endif
                           <input @if($found==1) checked @endif type="checkbox" name="workingDay[]" id="{{$key}}" value="{{$day}}"><label for="{{$key}}"> {{$day}}</label>
                    @endforeach
                </div>
            </div>
        </div>

    </div>
</div>

<div class="footer">
    <button type="submit" class="btn btn-info btn-fill pull-right">UPDATE</button>
    <button type="button" class="btn btn-default btn-simple pull-right" data-dismiss="modal">Close</button>
    <div class="clearfix"></div>
</div>
{!! Form::close() !!}
<script type="text/javascript">
    $().ready(function() {

        $('#myForm').validate();
    });
</script>