class Range extends Number
{
protected $_adminType = 'rangeofvalues';
+ protected $_cast = 'array';
protected $_viewNamespace = CubistBackpackServiceProvider::NAMESPACE . '::fields';
public function getDefaultAttributes()
{
$res = parent::getDefaultAttributes();
- $res['first_label'] = trans('cubist_back::first_value');
- $res['second_label'] = trans('cubist_back::second_value');
+ $res['first_label'] = trans('cubist_back::fields.first_value');
+ $res['second_label'] = trans('cubist_back::fields.second_value');
return $res;
}
}
$this->fill($attributes);
}
+ public function newFromBuilder($attributes = [], $connection = null)
+ {
+ $res = parent::newFromBuilder($attributes, $connection);
+ $this->onRetreived();
+ return $res;
+ }
+
+ public function onRetreived(){
+
+ }
+
/**
* Create translated items as json.
*