- Fitur: input pelanggaran, sistem poin, surat peringatan otomatis, SP progress - Realtime notifikasi via Laravel Reverb + Echo - Dashboard statistik, manajemen user, manajemen master data - Login 2 kolom premium, user dropdown, pengaturan akun - Tema biru kalem, logo sekolah dinamis, sidebar brand dinamis - Sinkronisasi siswa dari Database Kesiswaan via API
39 lines
1.4 KiB
PHP
39 lines
1.4 KiB
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
return new class extends Migration
|
|
{
|
|
public function up(): void
|
|
{
|
|
Schema::create('violations', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->foreignId('student_id')->constrained()->cascadeOnDelete();
|
|
$table->foreignId('violation_type_id')->constrained('violation_types')->cascadeOnDelete();
|
|
$table->foreignId('recorded_by')->nullable()->constrained('users')->nullOnDelete();
|
|
$table->text('description')->nullable();
|
|
$table->integer('points')->default(0);
|
|
$table->string('sanction')->nullable();
|
|
$table->string('location')->nullable();
|
|
$table->date('violation_date');
|
|
$table->time('violation_time')->nullable();
|
|
$table->boolean('is_verified')->default(false);
|
|
$table->foreignId('verified_by')->nullable()->constrained('users')->nullOnDelete();
|
|
$table->timestamp('verified_at')->nullable();
|
|
$table->text('notes')->nullable();
|
|
$table->timestamps();
|
|
$table->softDeletes();
|
|
|
|
$table->index('violation_date');
|
|
$table->index(['student_id', 'violation_date']);
|
|
});
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('violations');
|
|
}
|
|
};
|