'int', 'price_from' => 'float', 'trading_margin' => 'float', 'commission' => 'float' ]; protected $fillable = [ 'user_level_id', 'price_from', 'trading_margin', 'commission' ]; public function user_level() { return $this->belongsTo(UserLevel::class); } public function setPriceFromAttribute($value) { $this->attributes['price_from'] = $value ? Util::reFormatNumber($value) : 0; } public function getFormattedPriceFrom() { return isset($this->attributes['price_from']) ? Util::formatNumber($this->attributes['price_from']) : ""; } public function setTradingMarginAttribute($value) { $this->attributes['trading_margin'] = $value ? Util::reFormatNumber($value) : 0; } public function getFormattedTradingMargin() { return isset($this->attributes['trading_margin']) ? Util::formatNumber($this->attributes['trading_margin']) : ""; } public function setCommissionAttribute($value) { $this->attributes['commission'] = $value ? Util::reFormatNumber($value) : 0; } public function getFormattedCommission() { return isset($this->attributes['commission']) ? Util::formatNumber($this->attributes['commission']) : ""; } }