예제 #1
0
 /**
  * @param \Notadd\Foundation\Database\Eloquent\Model $model
  * @return array
  */
 protected function cleanPivotAttributes(Model $model)
 {
     $values = [];
     foreach ($model->getAttributes() as $key => $value) {
         if (strpos($key, 'pivot_') === 0) {
             $values[substr($key, 6)] = $value;
             unset($model->{$key});
         }
     }
     return $values;
 }