chore: stop tracking compiled blade cache
This commit is contained in:
+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)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user