namespace Cubist\Backpack\app\Magic\Fields;
-use Cubist\Backpack\app\Magic\Models\CubistMagicAbstractModel;
class Model extends Field
{
public function getColumnData()
{
$res = parent::getColumnData();
- $res['model'] = $this->getAttribute('model');
+ $res['model'] = $this->getAttribute('optionsmodel');
$res['attribute'] = $this->getAttribute('attribute');
return $res;
}
+ protected function _postSetAttributes()
+ {
+ parent::_postSetAttributes();
+ }
+
public function getDefaultAttributes()
{
return array_merge(parent::getDefaultAttributes(), ['attribute' => 'name', 'allows_null' => false, 'allows_multiple' => $this->_multiple]);
protected function _getOptions()
{
- $modelClass = $this->getAttribute('model');
+ $modelClass = $this->getAttribute('optionsmodel');
$inst = new $modelClass();
return $modelClass::all()->pluck($this->getAttribute('attribute'), $inst->getPrimaryKey());