- 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
32 lines
635 B
PHP
32 lines
635 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class ViolationType extends Model
|
|
{
|
|
protected $fillable = [
|
|
'category_id', 'name', 'slug', 'points',
|
|
'default_sanction', 'description', 'is_active',
|
|
];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'is_active' => 'boolean',
|
|
'points' => 'integer',
|
|
];
|
|
}
|
|
|
|
public function category()
|
|
{
|
|
return $this->belongsTo(ViolationCategory::class, 'category_id');
|
|
}
|
|
|
|
public function violations()
|
|
{
|
|
return $this->hasMany(Violation::class, 'violation_type_id');
|
|
}
|
|
}
|