TIF_NGANJUK_E41220778/resources/views/auth/login.blade.php

54 lines
2.1 KiB
PHP

<x-guest-layout>
@if ($errors->has('forbidden'))
<div class="alert alert-danger d-flex align-items-center" role="alert">
<i class="bi bi-exclamation-triangle-fill me-2"></i>
<div>{{ $errors->first('forbidden') }}</div>
</div>
@endif
<form method="POST" action="{{ route('login') }}">
@csrf
<input type="hidden" name="role" value="{{ $role }}">
<div class="text-center mb-4">
{{-- Judul dinamis --}}
<h3 class="fw-bold text-primary">Login {{ Str::title($role) }}</h3>
<p class="text-muted">
@if ($role == 'siswa')
Masukan NISN dan kata sandi Anda.
@else
Masukan Email dan kata sandi Anda.
@endif
</p>
</div>
{{-- Form dinamis --}}
@if($role == 'siswa')
<div class="mb-3">
<label for="nisn" class="form-label">Nomor Induk Siswa Nasional (NISN)</label>
<input id="nisn" class="form-control" type="text" name="nisn" required autofocus />
<x-input-error :messages="$errors->get('nisn')" class="mt-2" /> {{-- <-- Pastikan ini ada --}}
</div>
@else
<div class="mb-3">
<label for="email" class="form-label">Alamat Email</label>
<input id="email" class="form-control" type="email" name="email" required autofocus />
<x-input-error :messages="$errors->get('email')" class="mt-2" /> {{-- <-- Pastikan ini ada --}}
</div>
@endif
<div class="mb-3">
<label for="password" class="form-label">Kata Sandi</label>
<input id="password" class="form-control" type="password" name="password" required />
</div>
<div class="d-grid mt-4">
<button type="submit" class="btn btn-primary btn-lg">Masuk</button>
</div>
<p class="mt-4 text-center text-muted small">
Kembali ke <a href="/" class="fw-semibold text-decoration-none">halaman utama</a>.
</p>
</form>
</x-guest-layout>