<script src="{{ asset('js/modal_custom.js') }}"></script>

<!-- Name Field -->
<div class="form-group col-sm-12">
    {!! Form::label('name', 'Name:') !!}
    {!! Form::text('name', null, ['class' => 'form-control', 'maxlength' => 255, 'maxlength' => 255, 'maxlength' => 255]) !!}
</div>

<!-- Detail Field -->
<div class="form-group col-sm-12">
    {!! Form::label('detail', 'Detail:') !!}
    {!! Form::textarea('detail', null, ['class' => 'form-control', 'maxlength' => 65535,'rows'=>4]) !!}
</div>

<!-- Branch Field -->
@isset(auth()->user()->branch_id)
<div class="form-group col-sm-12">
    {!! Form::hidden('branch_id', auth()->user()->branch_id) !!}
</div>
@else
<div class="form-group col-sm-12">
    {!! Form::label('branch_id', 'Branch:') !!}
    {!! Form::select('branch_id', Common::getBranches(),null ,['class' => 'select2 form-select ','id'=>'branch_id']) !!}
</div>
@endisset
<!-- Status Field -->
<div class="form-group col-sm-12 mt-3">
    <div class="form-check">
       <input type="checkbox" name="status" id="status" class="form-check-input" value="1" @isset($menu->status) checked @endisset />
       <label for="status" class="pt-0">Is Active</label>

    </div>
</div>
{{-- <div class="col-sm-6 mt-2">
    @php
        
        if(isset($menu) && $menu->image_name){
            $image_url = asset('uploads/'.$menu->image_name);
        }else{
            $image_url = 'https://placehold.co/200X150?text=Upload+Image';
        }
    @endphp
    <img src="{{$image_url}}" id="output" height="150"  class="d-block rounded mt-2" />
     <label for="upload" class="btn btn-success content-center"  tabindex="0">
            <span class="d-none d-sm-block"><i class="ti ti-upload"></i>Select File</span>        
            <input type="file" id="upload" name="image_name" class="account-file-input" style="width: 200px;" hidden accept="image/png, image/jpeg" onchange="loadFile(event)" />
          </label>
     
</div> --}}

<script>

    var loadFile = function (event) {
      var image = document.getElementById("output");
      image.src = URL.createObjectURL(event.target.files[0]);
    };
    
    
    </script>

