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

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

    <div class="card-body">
        <form method="POST" action="{{ route("admin.subjects.store") }}" enctype="multipart/form-data">
            @csrf
            <div class="form-group">
                <label class="required" for="subject_name">Collector Name:</label>
                <input class="form-control {{ $errors->has('subject_name') ? 'is-invalid' : '' }}" type="text" name="subject_name" id="subject_name" value="{{ old('subject_name', '') }}" required>
                @if($errors->has('subject_name'))
                    <div class="invalid-feedback">
                        {{ $errors->first('subject_name') }}
                    </div>
                @endif
                <span class="help-block">{{ trans('cruds.subject.fields.subject_name_helper') }}</span>
            </div>
            <div class="form-group">
                <label class="required">{{ trans('cruds.subject.fields.level') }}</label>
                <select class="form-control {{ $errors->has('level') ? 'is-invalid' : '' }}" name="level" id="level" required>
                    <option value disabled {{ old('level', null) === null ? 'selected' : '' }}>{{ trans('global.pleaseSelect') }}</option>
                    @foreach(App\Subject::LEVEL_SELECT as $key => $label)
                        <option value="{{ $key }}" {{ old('level', '') === (string) $key ? 'selected' : '' }}>{{ $label }}</option>
                    @endforeach
                </select>
                @if($errors->has('level'))
                    <div class="invalid-feedback">
                        {{ $errors->first('level') }}
                    </div>
                @endif
                <span class="help-block">{{ trans('cruds.subject.fields.level_helper') }}</span>
            </div>
            <div class="form-group">
                <button class="btn btn-danger" type="submit">
                    {{ trans('global.save') }}
                </button>
            </div>
        </form>
    </div>
</div>



@endsection