Example #1
0
 /**
  * Attach a model instance to the parent model.
  *
  * @param  \Nova\Database\ORM\Model  $model
  * @return \Nova\Database\ORM\Model
  */
 public function save(Model $model)
 {
     $model->setAttribute($this->getPlainMorphType(), $this->morphClass);
     return parent::save($model);
 }
Example #2
0
 /**
  * Attach a model instance to the parent model.
  *
  * @param  \Nova\Database\ORM\Model  $model
  * @return \Nova\Database\ORM\Model
  */
 public function save(Model $model)
 {
     $model->setAttribute($this->getPlainForeignKey(), $this->getParentKey());
     return $model->save() ? $model : false;
 }