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',
|
||||
};
|
||||
}
|
||||
}
|
||||
+20
-2
@@ -21,6 +21,8 @@ class Matting extends Model
|
||||
'tgl_lahir_sire' => 'date',
|
||||
'tgl_lahir_dam' => 'date',
|
||||
'jumlah_anak_hidup' => 'integer',
|
||||
'pregnancy_confirmed_at' => 'date',
|
||||
'actual_birth_date' => 'date',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -92,7 +94,7 @@ class Matting extends Model
|
||||
{
|
||||
return Attribute::make(
|
||||
get: function () {
|
||||
if (!$this->edd || $this->status !== 'proses') return null;
|
||||
if (!$this->edd || !in_array($this->status, ['proses', 'hamil'], true)) return null;
|
||||
|
||||
$days = (int) now()->startOfDay()->diffInDays($this->edd->startOfDay(), false);
|
||||
|
||||
@@ -112,7 +114,8 @@ class Matting extends Model
|
||||
get: function () {
|
||||
$status = strtolower($this->status);
|
||||
return match($status) {
|
||||
'proses' => '<span class="px-3 py-1 bg-blue-50 text-blue-600 rounded-full text-[10px] font-black uppercase border border-blue-100">Dipantau</span>',
|
||||
'proses' => '<span class="px-3 py-1 bg-blue-50 text-blue-600 rounded-full text-[10px] font-black uppercase border border-blue-100">Menunggu konfirmasi</span>',
|
||||
'hamil' => '<span class="px-3 py-1 bg-amber-50 text-amber-700 rounded-full text-[10px] font-black uppercase border border-amber-100">Hamil / menunggu lahir</span>',
|
||||
'berhasil' => '<span class="px-3 py-1 bg-emerald-50 text-emerald-600 rounded-full text-[10px] font-black uppercase border border-emerald-100">Lahir</span>',
|
||||
'gagal' => '<span class="px-3 py-1 bg-rose-50 text-rose-600 rounded-full text-[10px] font-black uppercase border border-rose-100">Gagal</span>',
|
||||
default => '<span class="px-3 py-1 bg-slate-50 text-slate-600 rounded-full text-[10px] font-black uppercase">'.$status.'</span>',
|
||||
@@ -121,6 +124,21 @@ class Matting extends Model
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function scopeOpenBreeding($query)
|
||||
{
|
||||
return $query->whereIn('status', ['proses', 'hamil']);
|
||||
}
|
||||
|
||||
public function getFlowStepAttribute(): int
|
||||
{
|
||||
return match ($this->status) {
|
||||
'hamil' => 2,
|
||||
'berhasil', 'gagal' => 3,
|
||||
default => 1,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* PIC (Point of Contact)
|
||||
*/
|
||||
|
||||
@@ -30,6 +30,8 @@ class User extends Authenticatable
|
||||
'role', // Kode existing Anda
|
||||
'role_id', // Tambahan: ID untuk relasi tabel Role
|
||||
'phone',
|
||||
'is_active',
|
||||
'deactivated_at',
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -52,6 +54,8 @@ class User extends Authenticatable
|
||||
return [
|
||||
'email_verified_at' => 'datetime',
|
||||
'password' => 'hashed',
|
||||
'is_active' => 'boolean',
|
||||
'deactivated_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user