63 lines
3.6 KiB
PHP
63 lines
3.6 KiB
PHP
<x-app-layout>
|
|
@section('page-title', $pageTitle)
|
|
<div class="d-flex align-items-center mb-4">
|
|
<a href="{{ route('admin.pengumuman.index') }}" class="btn btn-outline-secondary me-3">
|
|
<i class="bi bi-arrow-left"></i>
|
|
</a>
|
|
<h3 class="my-0 fw-bold">Formulir Tambah Pengumuman</h3>
|
|
</div>
|
|
|
|
<div class="row justify-content-center">
|
|
<div class="col-md-10">
|
|
<div class="card border-0 shadow-sm">
|
|
<div class="card-body p-4">
|
|
<div class="card-body">
|
|
<form action="{{ route('admin.pengumuman.store') }}" method="POST">
|
|
@csrf
|
|
<div class="mb-3">
|
|
<label for="title" class="form-label">Judul Pengumuman <span class="text-danger">*</span></label>
|
|
<input type="text" name="title" class="form-control @error('title') is-invalid @enderror" id="title"
|
|
placeholder="Masukkan judul pengumuman" value="{{ old('title') }}" required minlength="3" maxlength="50">
|
|
@error('title')
|
|
<div class="invalid-feedback">{{ $message }}</div>
|
|
@enderror
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="type" class="form-label">Tipe Pengumuman <span class="text-danger">*</span></label>
|
|
<select name="type" class="form-select @error('type') is-invalid @enderror" id="type" required>
|
|
<option value="" disabled selected>Pilih tipe...</option>
|
|
<option value="info" {{ old('type') == 'info' ? 'selected' : '' }}>Info</option>
|
|
<option value="success" {{ old('type') == 'success' ? 'selected' : '' }}>Success</option>
|
|
<option value="warning" {{ old('type') == 'warning' ? 'selected' : '' }}>Warning</option>
|
|
<option value="danger" {{ old('type') == 'danger' ? 'selected' : '' }}>Danger</option>
|
|
</select>
|
|
@error('type')
|
|
<div class="invalid-feedback">{{ $message }}</div>
|
|
@enderror
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="content" class="form-label">Isi Pengumuman <span class="text-danger">*</span></label>
|
|
<textarea name="content" class="form-control @error('content') is-invalid @enderror" id="content" rows="5" placeholder="Tulis isi pengumuman di sini..." required minlength="3">{{ old('content') }}</textarea>
|
|
@error('content')
|
|
<div class="invalid-feedback">{{ $message }}</div>
|
|
@enderror
|
|
</div>
|
|
<hr>
|
|
<div class="d-flex justify-content-end">
|
|
<button type="submit" class="btn btn-primary px-4 fw-bold">Simpan Pengumuman</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
@push('scripts')
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
// Script removed to allow standard server-side validation
|
|
});
|
|
</script>
|
|
@endpush
|
|
</x-app-layout> |