where('row_status', 1); } public function scopeIsActive($query) { return $query->where('active_status', 1); } public function scopeOrderByRowNum($query) { $table = $this->getTable(); if (Schema::hasColumn($table, 'row_num')) { return $query->orderBy('row_num', 'asc'); } return $query; } // public function getValueAttribute($value) // { // $table = $this->getTable(); // if (Schema::hasColumn($table, 'value')) { // $value = (float) $value; // Convert the value to a float to handle scientific notation // $value = number_format($value, 10, ',', '.'); // Convert back to a string with custom formatting // $value = rtrim(rtrim($value, '0'), ','); // Remove unnecessary zeros and trailing commas // return $value; // } // return $value; // } // public function setValueAttribute($value) // { // $table = $this->getTable(); // if (Schema::hasColumn($table, 'value')) { // $value = str_replace(',', '.', str_replace('.', '', $value)); // Remove any thousand separators and replace comma // $this->attributes['value'] = $value; // } else { // $this->attributes['value'] = $value; // Handle default behavior if 'value' column does not exist // } // } }