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'); } };