'array', 'pos' => 'int' ]; public $timestamps = false; public function sluggable(): array { return [ 'slug' => [ 'source' => 'name' ] ]; } public function _format_number($value){ return preg_replace("/[^0-9,]/", "", $value); } public function setDecimalAttribute($value) { $value = $this->_format_number($value); $value = substr($value, -13); $this->attributes['decimal'] = (float) str_replace(',', '.', $value); } public function getDecimalAttribute() { if(isset($this->attributes['decimal'])){ // 2 = decimal places | '.' = decimal seperator | ',' = thousand seperator return number_format(($this->attributes['decimal']), 2, ',', '.'); } return ""; } public function setIntegerAttribute($value) { $value = $this->_format_number($value); $value = substr($value, -10); $this->attributes['integer'] = intval($value); } }