chore: stop tracking compiled blade cache
This commit is contained in:
+29
-1
@@ -23,7 +23,8 @@ class Cat extends Model
|
||||
'jadwal_vaksin', 'jadwal_obat_cacing', 'jadwal_obat_kutu',
|
||||
'jadwal_grooming', 'induk_jantan_id', 'induk_betina_id',
|
||||
'lokasi_kandang', 'pic_id', 'berat_badan',
|
||||
'pedigree','sertifikat_ped_file', 'microchip', 'status', 'kode_ems','treatment_status'
|
||||
'pedigree','sertifikat_ped_file', 'microchip', 'status', 'kode_ems','treatment_status',
|
||||
'cattery_status','adopted_at','adoption_notes'
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -69,6 +70,7 @@ class Cat extends Model
|
||||
'registry' => 'array', // Otomatis mengurus JSON di DB
|
||||
'berat_badan' => 'decimal:2',
|
||||
'berat_terakhir' => 'decimal:2',
|
||||
'adopted_at' => 'date',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -241,4 +243,30 @@ public function scopeHealthy($query)
|
||||
{
|
||||
return $query->where('treatment_status', 2);
|
||||
}
|
||||
|
||||
public function scopeActiveInCattery($query)
|
||||
{
|
||||
return $query->where(function ($q) {
|
||||
$q->whereNull('cattery_status')->orWhere('cattery_status', 'active');
|
||||
});
|
||||
}
|
||||
|
||||
public function scopeAdopted($query)
|
||||
{
|
||||
return $query->where('cattery_status', 'adopted');
|
||||
}
|
||||
|
||||
public function scopeExternalParents($query)
|
||||
{
|
||||
return $query->where('cattery_status', 'external_parent');
|
||||
}
|
||||
|
||||
public function getCatteryStatusLabelAttribute(): string
|
||||
{
|
||||
return match ($this->cattery_status ?: 'active') {
|
||||
'adopted' => 'Teradopsi',
|
||||
'external_parent' => 'Induk eksternal',
|
||||
default => 'Aktif di cattery',
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user