<div class="form-group"> <label>Alamat</label> <input type="text" class="form-control" name="alamat" value="{{ $pembudidaya->alamat }}" required> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>Kecamatan</label> <div id="kecamatan"> <select class="full-width" data-init-plugin="select2" name="kecamatan" onchange="get_desa(this.value)" required> <option value="">Pilih Kecamatan...</option> <?php $kecamatan = App\Kecamatan::get(); ?> @foreach ( $kecamatan as $kec ) <option value="{{ $kec->id }}" {{ $kec->id == $pembudidaya->desa->kecamatan->id ? 'selected':'' }}>{{ $kec->nama }}</option> @endforeach </select> </div> </div> </div> <div class="col-sm-6"> <label><b>Desa/Kelurahan</b></label> <div class="form-group"> <span id="desa"> <select class="full-width" name="desa" data-init-plugin="select2" required> <?php