diff --git a/resources/views/reports/violation-report-pdf.blade.php b/resources/views/reports/violation-report-pdf.blade.php
index 77cfa4f..78571da 100644
--- a/resources/views/reports/violation-report-pdf.blade.php
+++ b/resources/views/reports/violation-report-pdf.blade.php
@@ -146,7 +146,12 @@
{{ $v->student?->nisn }} |
{{ $v->student?->full_name }} |
{{ $v->student?->class?->name }} |
- {{ $v->violationType?->name }} ({{ $v->violationType?->category?->name ?? '-' }}) |
+
+ {{ $v->violationType?->name }} ({{ $v->violationType?->category?->name ?? '-' }})
+ @if ($v->description)
+ {{ $v->description }}
+ @endif
+ |
{{ $v->points }} |
{{ $status }} |
diff --git a/resources/views/reports/violations.blade.php b/resources/views/reports/violations.blade.php
index 1b34eaa..5f01f93 100644
--- a/resources/views/reports/violations.blade.php
+++ b/resources/views/reports/violations.blade.php
@@ -277,7 +277,12 @@
{{ $v->student?->class?->name }}
|
- {{ $v->violationType?->name }} |
+
+ {{ $v->violationType?->name }}
+ @if ($v->description)
+ {{ $v->description }}
+ @endif
+ |
{{ $v->points }}
|
diff --git a/tests/TestCase.php b/tests/TestCase.php
index fe1ffc2..bf3734c 100644
--- a/tests/TestCase.php
+++ b/tests/TestCase.php
@@ -3,8 +3,28 @@
namespace Tests;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
+use Illuminate\Support\Facades\DB;
abstract class TestCase extends BaseTestCase
{
- //
+ /**
+ * Pengaman: pastikan test HANYA boleh jalan di database test.
+ *
+ * Jika konfigurasi ter-cache (config:cache) membuat test menunjuk ke
+ * database produksi, RefreshDatabase akan menghancurkan data asli —
+ * guard ini menghentikan suite sebelum itu terjadi.
+ */
+ protected function setUp(): void
+ {
+ parent::setUp();
+
+ $dbName = config('database.connections.'.config('database.default').'.database');
+
+ if (! str_ends_with((string) $dbName, '_test')) {
+ throw new \RuntimeException(
+ "TEST DIBLOKIR: database aktif '{$dbName}' bukan database test (harus berakhiran _test). ".
+ 'Jalankan `php artisan config:clear` lalu ulangi test.'
+ );
+ }
+ }
}