@extends('layouts.admin')
@section('content')

<div class="card">
    <div class="card-header">
        {{ trans('global.edit') }} {{ trans('cruds.bimbingan.title_singular') }}
    </div>

    <div class="card-body">
        <form action="{{ route("admin.bimbingans.update", [$bimbingan->id]) }}" method="POST" enctype="multipart/form-data">
            @csrf
            @method('PUT')
            <div class="form-group {{ $errors->has('nama_id') ? 'has-error' : '' }}">
                <label for="nama">{{ trans('cruds.bimbingan.fields.nama') }}</label>
                <select name="nama_id" id="nama" class="form-control select2">
                    @foreach($namas as $id => $nama)
                        <option value="{{ $id }}" {{ (isset($bimbingan) && $bimbingan->nama ? $bimbingan->nama->id : old('nama_id')) == $id ? 'selected' : '' }}>{{ $nama }}</option>
                    @endforeach
                </select>
                @if($errors->has('nama_id'))
                    <em class="invalid-feedback">
                        {{ $errors->first('nama_id') }}
                    </em>
                @endif
            </div>
            <div class="form-group {{ $errors->has('no_register') ? 'has-error' : '' }}">
                <label for="no_register">{{ trans('cruds.bimbingan.fields.no_register') }}</label>
                <input type="text" id="no_register" name="no_register" class="form-control" value="{{ old('no_register', isset($bimbingan) ? $bimbingan->no_register : '') }}">
                @if($errors->has('no_register'))
                    <em class="invalid-feedback">
                        {{ $errors->first('no_register') }}
                    </em>
                @endif
                <p class="helper-block">
                    {{ trans('cruds.bimbingan.fields.no_register_helper') }}
                </p>
            </div>
            <div>
                <input class="btn btn-danger" type="submit" value="{{ trans('global.save') }}">
            </div>
        </form>
    </div>
</div>
@endsection