<a href="#" onclick="document.getElementById('picture-{{$model->id}}').click()" title="Klik untuk ganti gambar"><img src="<?php if($model->picture != NULL){ echo url('assets/files/pages/'.$model->picture.'?time='.time()); }else{ echo url('assets/frontend/img/no-picture.png?time='.time()); } ?>" width="500px"></a>
<form method="post" action="{{ route('pages.update_foto') }}" enctype="multipart/form-data">
  {{csrf_field()}}
  <input type="hidden" name="id" value="{{ $model->id }}">
  <input type="hidden" name="_token" id="_token" value="{{csrf_token()}}">
  <input style="display: none;" type="file" name="picture" id="picture-{{$model->id}}" data-id="{{$model->id}}" class="uploadfoto" accept="image/*">
</form>
@if($model->picture != NULL)
<button class="btn btn-xs btn-warning" id="hapusGambar" data-id={{$model->id}}><i class="fa fa-close"> Hapus Gambar</i></button>
@endif
<p style="font-size: 14px; color:red;">Size gambar max: 500kb!</p>
