How to update checkbox field value using Laravel

 








blade file 

        <div class="col-lg-4">
                        <label for="checkbox">
                            <input type="hidden" value="0" name="hot_new">
                            <input type="checkbox" name="hot_new"value="1"
                                @if (isset($product)) 
                                @if ($product->hot_new==1checked @endif
                                 @endif id="">
                            <span>Hot New</span>
                        </label>
                      </div>

                      <div class="col-lg-4">
                        <label for="checkbox">
                            <input type="hidden" value="0" name="trend">
                            <input type="checkbox" name="trend" value="1"
                             @if (isset($product)) 
                                @if ($product->trend==1checked @endif 
                                @endif  id="">
                            <span>Trend Product</span>
                        </label>
                      </div>

                      <div class="col-lg-4">
                        <label for="checkbox">

                            <input type="hidden" value="0" name="status">
                            <input type="checkbox" name="status" value="1" 
                                @if (isset($product)) 
                                @if ($product->status==1checked @endif
                             @endif id="">
                            <span>tick for publish</span>
                        </label>

Post a Comment

Previous Post Next Post